I'll put together some of the Linux commands in this post for future reference, and this post will be updated whenever there's something new coming to me.
How to view the content of a .tar.gz file?
# tar tf file.tar.gz
How to extract .tar.gz file?
# tar zvxf file.tar.gz
How to extract .tar.bz2 file?
# tar jvxf file.tar.bz2
How to recursively copy a folder with subfolders?
# cp -R foldername
Here I can use -L to replace soft links by their actually content and -P to never follow soft links sources. Note that adding -L may greatly increase the destination folder size.
-a is the same as -dpR, where -d means -P --preserve=link, and -p means --preserver=mode.
-s makes symbolic links instead of copying, same as ln -s.
How to make ls show human readable file size?
# ls -sh
or
# ls -lh
Note that h shows size in human readable form but doesn't work alone, there has gotta be some argument that asks ls to show file size.
How to make ls sort files by size and show their sizes one file per line?
# ls -1Ssh
Note that -1 shows on file per line, -S sorts file by size, -s shows file size and -h shows file size in human readable form.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment