Command Memento UNIX LINUX
Command Memento UNIX LINUX
Test (list) a compressed archive: tarztvfarchive.tar.gz tarjtvfarchive.tar.bz2 tarlzmatvfarchive.tar.lzma Extract the contents of a compressed archive: tarzxvfarchive.tar.gz tarjxvfarchive.tar.bz2 tarlzmaxvfarchive.tar.lzma tar options: c: create t: test x: extract j: on the fly bzip2 (un)compression z: on the fly gzip (un)compression Handling zip archives ziprarchive.zip<files>(create) unziptarchive.zip (test / list) unziparchive.zip (extract)
bcl
Printing
Send PostScript or text files to queue: lprPqueuef1.psf2.txt (local printer) List all the print jobs in queue: lpqPqueue Cancel a print job number in queue: cancel123queue Print a PDF file: pdf2psdoc.pdf lprdoc.ps View a PostScript file: ps2pdfdoc.ps xpdfdoc.pdf
Job control
Show all running processes: psef Live hit-parade of processes (press P, M, T: sort by Processor, Memory or Time usage): top Send a termination signal to a process: kill<pid>(number found in ps output) Have the kernel kill a process: kill9<pid> Kill all processes (at least all user ones): kill91 Kill a graphical application: xkill(click on the program window to kill)
User management
List users logged on the system: who Show which user I am logged as: whoami Show which groups user belongs to: groupsuser Tell more information about user: fingeruser Switch to user hulk: suhulk Switch to super user (root): su(switch user) su(keep same directory and environment)
Listing files
List all regular files (not starting with .) in the current directory: ls Display a long listing: lsl List all the files in the current directory, including hidden ones (starting with .): lsa List by time (most recent files first): lst List by size (biggest files first) lsS List with a reverse sort order: lsr Long list with most recent files last: lsltr
Time management
Wait for 60 seconds: sleep60 Show the current date: date Count the time taken by a command: timefind_charming_princecuterich
Compressing
Compress a file: gzipfile(.gz format) bzip2file(.bz2 format, better) lzmafile (.lzma format, best compression) Uncompress a file: gunzipfile.gz bunzip2file.bz2 unlzmafile.lzma
Command help
Basic help (works for most commands): grephelp Access the full manual page of a command: mangrep
Archiving
Create a compressed archive (tape archive): tarzcvfarchive.tar.gzdir tarjcvfarchive.tar.bz2dir tarlzmacvfarchive.tar.lzma
Misc commands
Basic command-line calculator