Basic Linux Commands

lslist files and directories in the current directory
cdchange directory
pwdprint working directory
mkdircreate a new directory
rmremove a file or directory
cpcopy a file or directory
mvmove or rename a file or directory
catdisplay the contents of a file
chmodchanges the permissions of a file or directory
lsblklists all available block devices (such as hard drives and USB drives)
dfdisplays the amount of disk space used and available on the file system
topdisplays a list of running processes and system resource usage
historydisplays a list of previously executed commands
killterminates a process by ID or name
touchcreates an empty file or updates the timestamp of an existing file
grepsearch for a specific pattern in a file
Syntax: grep [pattern] [filename]
Example: grep “error” logfile.txt
sudoexecute a command with superuser privileges
sudo suswitches to the root user account
mandisplays the manual pages for a command
headdisplays the first few lines of a file
taildisplays the last few lines of a file
apt-getcommand-line tool used to manage software packages in Debian-based Linux distributions
sshsecure shell client used to remotely connect to a server
scpsecure copy used to transfer files between two computers securely
psdisplays information about the running processes
unamedisplays the name and version of the current operating system
crontabused to schedule tasks to run automatically at specific times
Scroll to Top