Some handy Linux commands
Many of these commands require root privilege, use sudo and
the
command name, and when asked enter your password.
- basic tcp/ip commands:
ifconfig, ping, traceroute
- Updating packages in your system :
apt update (retrieves list), then apt upgrade (actually
update packages)
- Installing packages in your system :
apt install package name, e.g. apt install nmap
- running a program, script not in the path:
./programname
- deleting (removing) files:
rm -i filename
- deleting (removing) empty directories:
rmdir directoryname
- deleting (removing) directories and files inside the
directories:
rm -r directoryname
- making a file have owner rwx, group and world rx
permissions:
chmod 755 filename
- making a file have owner rw, group and world r permissions:
chmod 644 filename
- making a shell script executable:
chmod u+x scriptname
- changing password:
passwd
- root changing (creating) user password:
passwd username
- uncompressing gz files:
gzip -d filename.tar.gz
- uncompressing tar files:
tar -xvf filename.tar
This page is maintained by Al Bento
who can be reached at abento@ubalt.edu.
This page was last updated on September 25, 2017. Although we will
attempt to keep this information accurate, we can not guarantee the
accuracy of the information provided.