/Linux Commands

Linux Commands

Unlike working with graphical environment, command line has powerful .You feel you can do everything.

That right, everything at your disposal.

This is collection of most command lines (99 commands) not all. Some I use every day, some I don’t remember that I use and others I only learned and keep it hot trying to divide it some for basic and some for network others advanced basics.

This section has most basics commands like help, list file and other:

“man”

Purpose: manual for command line programs.

“whatis”

Purpose: Display a description of the specified command.

“Ls”

Purpose: list the contents of a directory.

“pwd”

Purpose: Display the current/working directory.

“cd”

Purpose: Change directories.

“find”

Purpose: Search for files and directories.

“locate”

Purpose: Search the locate database for files and directories.

“whereis”

Purpose: Display the location of binary files, manual pages, and source code for the

 
Specified Command
 “file”

Purpose: Display the file type of the specified file.

“date”

Purpose: Display or set the system clock.

“cal”

Purpose: Display a calendar on the command line.

“history”

Purpose: Display commands that have recently been executed.

“clear”

Purpose: Clear the contents of the current screen.

“logout”

Purpose: Log out of the system.

“exit”

Purpose: Exit the current shell.

Advanced

This section has most of advanced commands such as copying file and deleting it, text editor, dealing with user and groups, process, startup and shutdown the system

“mv”

Purpose: Move or rename files and directories.

“cp”

Purpose: Copy files and directories.

“rm”

Purpose: Remove files.

“mkdir / rmdir”

Purpose: Create/remove directories.

“touch”

Purpose: Create a file.

“lsof”

Purpose: List open files.

“ln”

Purpose: Create links (shortcuts) to files or directories.

“alias”

Purpose: Create command line aliases.

“env”

Purpose: Display environment variables.

“nano”

Purpose: Simple text editor.

“emacs”

Purpose: Robust and extensible text editor.

“strings”

Purpose: Extract readable characters from binary files.

“cat”

Purpose: Concatenate files and display their contents.

“tac”

Purpose: Concatenate files in reverse order.

“wc”

Purpose: Count the number of lines, words, and characters in a file.

“more”

Purpose: Display the output of a command or text file one page at a time.

“less”

Purpose: Display the output of a command or text file one page (or line) at a time.

“head”

Purpose: Display the first part of a file.

“tail”

Purpose: Display the last part of a file.

“tee”

Purpose: Display the output of a command and write the output to a file.

“sort”

Purpose: Sort the contents of an input stream or file.

“zcat”

Purpose: Read the contents of a compressed file.

“chmod”

Purpose: Change file and directory permissions.

“chown”

Purpose: Change the owner of a file or directory.

“chgrp”

Purpose: Change the group of files and directories.

“umask”

Purpose: Display/set a user’s default file creation mask.

“su”

Purpose: Switch user accounts.

“sudo”

Purpose: Run a single command as a different user.

“id”

Purpose: Display information about a user’s identity.

“groups”

Purpose: Display which groups a user belongs to.

“who / whoami”

Purpose: Display who is logged into the system.

“w”

Purpose: Display detailed information about users logged in to the system.

“last / lastb”

Purpose: Display the last successful/failed user logins.

“lastlog”

Purpose: Display the most recent user login information.

“finger”

Purpose: Display information about a user account.

“passwd”

Purpose: Change passwords.

“useradd / userdel”

Purpose: Create/delete user accounts.

“adduser / deluser”

Purpose: Create/delete user accounts on Linux systems.

“groupadd / groupdel”

Purpose: Add/remove a group.

“usermod / groupmod”

Purpose: Modify user and group account settings.

“wall”

Purpose: Broadcast a message to all users on the system.

“ulimit”

Purpose: Display/set system resource limits.

“ps”

Purpose: Display running processes.

“pgrep”

Purpose: Find processes by name.

“pstree”

Purpose: Display all running processes in a tree view.

“kill”

Purpose: Terminate a process.

“killall”

Purpose: Terminate all processes with the specified name.

“at / atq / atrm”

Purpose: Schedule a program to run at the specified time.

“batch”

Purpose: Schedule programs to run during low CPU load.

“shutdown”

Purpose: Shut down the system.

“poweroff”

Purpose: Power off the system.

“reboot”

Purpose: Reboot the system.

“halt”

Purpose: Halt the system.

“runlevel”

Purpose: Display the previous and current run level.

“chkconfig”

Purpose: Display and edit run level configuration on Red Hat Linux-based systems.

This section covered basic networking and configuration commands

“hostname”

Purpose: Display the system’s host name.

“ifconfig”

Purpose: Display network interfaces.

“ifup / ifdown”

Purpose: Enable/disable network interfaces.

“iwconfig”

Purpose: Display wireless network interfaces.

“ethtool”

Purpose: Display ethernet card settings.

“arp”

Purpose: Display the ARP cache.

“ping”

Purpose: Send ICMP echo requests to network hosts.

“traceroute”

Purpose: Display TCP/IP routing information.

“tracepath”

Purpose: Display TCP/IP routing information on Linux systems.

“nslookup”

Purpose: Perform DNS lookups on Unix systems.

“dig”

Purpose: Perform DNS lookups on BSD and Linux systems.

“host”

Purpose: Simple DNS lookup utility.

“whois”

Purpose: Lookup domain name registry information in the WHOIS database.

“netstat”

Purpose: Display network connections, statistics, and routing information.

“route”

Purpose: Display and configure TCP/IP routes.

“tcpdump”

Purpose: Displays raw traffic on a network interface.

“nmap”

Purpose: Scan TCP/IP ports on network systems.

“ftp”

Purpose: Transfer files using FTP and some didn’t found any place for it

“top”

Purpose: Monitor system performance and running processes.

“htop”

Purpose: Advanced system monitor for Linux.

“free”

Purpose: Display system memory and swap space usage information.

“df”

Purpose: Display file system usage information.

“du”

Purpose: Display disk usage.

“uname”

Purpose: Display information about the operating system.

“uptime”

Purpose: Display how long the system has been online.

“dmesg”

Purpose: Display kernel log messages.

“strace”

Purpose: Trace system calls and signals.

“ltrace”

Purpose: Trace library calls.

“lsmod”

Purpose: Display Linux kernel module information.

The idea is not in keeping all commands but you must know what you need in timely manner and you have to remember

UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity.” – Dennis Ritchie