Displaying file contents Comparing 2 directories: tar jcvf archive.tar.bz2 dir Misc commands GNU/Linux most wanted diff -r dir1 dir2 tar Jcvf archive.tar.xz dir Concatenate and display file contents: tar --lzma -cvf archive.tar.lzma Basic command-line calculator Summary of most useful commands cat file1 file2 Looking for files bc -l Test (list) a compressed archive: ©Copyright 2017-2005, Free Electrons. Display the contents of several files (stopping Find all files in the current (.) directory and its tar tvf archive.tar.[gz|bz2|lzma|xz] Basic system administration Free to share under the terms of the Creative Commons at each page): subdirectories with log in their name: Attribution-ShareAlike 3.0 license more file1 file2 find . -name “*log*” Extract the contents of a compressed archive: Change the owner and group of a directory and (http://creativecommons.org) less file1 file2 (better: extra features) tar xvf archive.tar.[gz|bz2|lzma|xz] all its contents: Find all the .pdf files in dir and subdirectories sudo chown -R newuser.newgroup dir Electronic version, sources, translations and updates: Display the first 10 lines of a file: and run a command on each: tar options: http://free-electrons.com/doc/legacy/command-line/ head -10 file find . -name “*.pdf” -exec xpdf {} ';' c: create Reboot the machine in 5 minutes: t: test sudo shutdown -r +5 Thanks to Michel Blanc, Hermann J. Beckers and Thierry Display the last 10 lines of a file: Grellier. Quick system-wide file search by pattern x: extract tail -10 file (caution: index based, misses new files): Shutdown the machine now: j: on the fly bzip2 (un)compression sudo shutdown -h now Latest update: Feb 8, 2017 locate “*pub*” File name pattern matching J: on the fly xz (un)compression z: on the fly gzip (un)compression Display all available network interfaces: Handling files and directories Concatenate all “regular” files: Redirecting command output ifconfig -a Handling zip archives Create a directory: cat * Redirect command output to a file: zip -r archive.zip
<<