This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Extract files fomr mydir.tar | |
tar xvf mydir.tar | |
# Create the archive for file mydir and compress with gzip | |
tar zcvf mydir.tar.gz mydir | |
# Create the archive for file mydir and compress with bz2 | |
tar jcvf mydir.tar.bz2 mydir | |
# Create the archive for file mydir and compress with xz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# redirect stdout | |
echo "hello" > a.out | |
# redirect stderr | |
echo "hello" 2> a.out | |
# redirect both of them | |
echo "hello" > a.out 2>&1 | |
# shortcut | |
echo "hello" >& a.out |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Look up hostname using dns | |
host linuxfoundation.org | |
# To look up name server interactively | |
nslookup linuxfoundation.org | |
# To look up domain name server information from the name server | |
dig linuxfoundation.org | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find filename with gcc under folder /usr | |
find /usr -name gcc | |
# Find directory based on filename gcc under folder /usr | |
find /usr -type d -name gcc | |
# Find file which modified today under current directory | |
find -type f -mtime 0 | |
# Find file which filesize is zero |
NewerOlder