Linux Commands

Linux Commands #

  • adduser
  • alias - Create an alias for a command
  • apropos - Display a list of appropriate commands
  • aspell - Interactive spell checker aspell check textfile Can be used to spell-check specific file types like HTML for example.
  • bc
  • bg - Place a job in the background
  • bzip2 - A block sorting file compressor Similar to gzip but uses different compression algorithm. Achieves higher levels of compression at the cost of speed. Similar options to gzip. .bz2 bunzip2, bzcat, bzip2recover
  • cal
  • cat
  • cd
  • chgrp - Change a file’s group ownership
  • chmod - Change a file’s mode Supports octal or symbolic
  • cut
  • diff
  • dig
  • expect
  • find
  • fmt
  • fold
  • git
  • grep
  • gzip
  • host
  • info
  • kill
  • less
  • nl
  • printf
  • read
  • rsync
  • sed
  • sort
  • ssh - OpenSSH SSH client (remote login program)
  • stow
  • strace
  • symlinks
  • tar
  • tcpdump
  • tmux
  • tr
  • tree
  • tty
  • umask
  • uniq
  • xargs
  • chown - Change a file’s owner
  • clear - Clear the screen
  • comm - Compare two sorted files line by line comm file1.txt file2.txt
  • cp
  • date
  • dd - Convert and copy a file
  • df
  • echo - Display a line of text echo -e "Time's up\a" # enable interpretation of escapes
  • exit
  • expand - Change tabs to spaces from stdin. Goes with unexpand
  • export - Export environment to subsequently executed programs
  • fdisk - Manipulate disk partition table
  • fg - Place a job in the foreground
  • file - Determines a file’s type
  • free
  • fsck - Check and repair a file system
  • ftp - Internet file transfer program
  • genisoimage (mkisofs) - Create an ISO 9660 image file
  • groff - A document formatting system Good to know a tool exists for formatting and exporting pretty documents.
  • groupadd
  • head - Output the first part of a file
  • help - Get help for shell builtins
  • history - Display the contents of the history list
  • id - Display user identity
  • id - print real and effective user and group IDs
  • ip - Show / manipulate routing, devices, policy routing and tunnels
  • jobs - List active jobs
  • join - Join lines of two files on a common field Combine fields from two tables using a shared key
  • killall - Kill processes by name killall [-u user] [-signal] name...
  • lftp - A better way to ftp
  • ln
  • locate - Find files by name locate bin/zip
  • ls
  • lscpu - display information about the CPU architecture
  • make - Utility to maintain programs Smart enough to only compile files with newer source to new targets After downloading and unzipping a source package, usually you run ./configure make sudo make install Assuming there were no errors in ./configure
  • man - Display a command’s manual page
  • md5sum - Calculate an MD5 checksum
  • mkdir
  • mkfs - Create a file system
  • mount - Mount a file system
  • mv
  • netstat - Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships
  • passwd - Change a user’s password
  • paste - Merge lines of files Combines multiple files into single stream on stdout.
  • patch - Apply a diff file to an original after preparation with diff patch < diff_file
  • pcregrep
  • ping - Send an ICMP ECHO REQUEST to network hosts
  • pr - Prepare text for printing The pr program is used to paginate text.
  • printenv - Print part or all of the environment
  • ps - Report a snapshot of current processes
  • pstree - Outputs a process list arranged in a tree
  • pwd
  • rm
  • scp - Secure copy. Part of OpenSSH package.
  • script
  • set - Set shell options
  • sftp - Secure file transfer protocol. Part of OpenSSH package.
  • shutdown - Shutdown or reboot the system
  • stat - Display file or file system status
  • su - Run a shell as another user
  • sudo - Execute a command as another user
  • tail - Output the last part of a file
  • tee - Read from standard input and write to standard output and files
  • tload - Similar to xload program but draws the graph in the terminal.
  • top - Display tasks
  • touch - Change file times
  • traceroute - Print the route packets trace to a network host
  • type - Indicate how a command name is interpreted
  • umount - Unmount a file system
  • unexpand - Change spaces to tabs from stdin. Goes with expand
  • unzip
  • useradd
  • vmstat - Outputs a snapshot of system resource usage including, memory, swap, and disk I/O. To see a continuous display, follow the command with a time delay (in seconds) for updates. Here’s an example: vmstat 5. Terminate the output with Ctrl-c.
  • wc - Print newline, word, and byte counts for each file
  • wget - Non-interactive network downloader
  • whatis - Display one-line manual page descriptions
  • which - Display which executable program will be executed
  • who - show who is logged on
  • whoami - print effective userid
  • wodim (cdrecord) - Write data to optical storage media
  • write - send a message to another user
  • xload - A graphical program that draws a graph showing system load over time
  • zcat
  • zgrep - Like grep but for compressed files
  • zip - Package and compress files zip, unzip .zip zip -r playground.zip playground
  • zless
  • w (1) - Show who is logged on and what they are doing.
  • last (1) - show a listing of last logged in users
  • lastb (1) - show a listing of failed login attempts
  • lastlog (8) - reports the most recent login of all users or of a given user
  • id (1) - print real and effective user and group IDs
  • groups (1) - print the groups a user is in
  • chage (1) - change user password expiry information
  • groupadd (8) - create a new group
  • groupdel (8) - delete a group
  • groupmod (8) - modify a group definition on the system
  • logname (1) - print user’s login name
  • env - print all of part of the environment
  • unset (1p) - unset values and attributes of variables and functions
  • pidof (1) - find the process ID of a running program
  • [root@server1 ~]# whatis pgrep pgrep (1) - look up, signal, or wait for processes based on name and other attributes