Ubuntu

Some of the useful Ubuntu commands along with its descriptions. This might be used as a handy reference to quickly know about the syntax of a command.

Command Description
wget URL Downloads the file specified by the URL.
pwd Displays the current directory you are in.
sudo Allows the user to act like a superuser
sudo -i Allows the user to get root access.
sudo apt-get install package_name Allows the user to act like a superuser and install packages
cd directory_name Changes from current directory to the mentioned directory.
cd .. Moves back one directory
ls To view the contents in a directory including files and sub-directories.
ls -a To view the contents in a directory including hidden files.
man command Displays the information about the command specified.
whereis file/directory Shows where the specified file/directory is.
mkdir directory_name Creates a directory with the given name.
mv oldname newname Renames the file.
rm filename Removes the specified filename.
rmdir directoryname Removes the specified empty directory.
rm -r directoryname Removes files and sub-directories in the specified directory.
ifconfig & iwconfig Allows the user to look at the network configuration.
ping URL Allows the user to test connectivity issues.
vi filename Opens the specified file in the vi editor to view/make changes.
telnet ip_address Connects to the specified IP address.
chmod 777 file_name Modifies the permissions of the specified file.

  • 4 – Read
  • 2 – Write
  • 1 – Execute
  • 0 – No permissions

The three digits in 777 represents users, groups and others.
7 means – 4 + 2 + 1, meaning users can read, write and execute.

chmod -R 777 directory Modifies the permissions of the specified directory recursively. Meaning it applies the changes for all the files and sub-directories.
Read more