Some Basic Linux Commands

What are system admin tasks or operations?

  • In many computer science spaces such as Cloud and DevOps, you might be assigned certain tasks related to something that we call ‘system administration’.
  • System administration may involve managing the configuration of the system, checking the metadata of folders, files, etc., maintaining the system and ensuring that operations on the system are up and running.
  • A ‘SysAdmin’ handles servers, monitors system performance and ensures the security of the system. Therefore, these tasks are of the utmost importance, especially in spaces such as Cloud and DevOps.

Important Sys Admin Commands

  1. pwd: This stands for Print Working Directory. When invoked, the full path of the current working directory will be printed to the standard output.

cd: This stands for Change Directory. It is used to change the current working directory. By default, it will navigate you to the home directory.

cd /: This command will navigate you to the root directory. The root directory is the first directory in your file system.

  • cd ..: This command will navigate you to the parent directory of the current directory. The parent directory is one level above the current directory. Essentially, these commands help you ‘go back’ in the directory tree.
  • cd or cd~: This command is used to move to the home directory.
  • cd/abc/xyz: This command is used to directly go to the xyz subdirectory of abc. This command is useful when you already know the path of the folder/file that you wish to access and hence can directly move there.

ls: This is used to list all the files and directories present within the file system.

mkdir: This stands for Make Directory. This command allows the user to create directories. You can create a directory by specifying the name of the directory after the command. You can create multiple directories at once by specifying multiple names after the command.

let’s learn more about some common administrative commands such as:

  • cp: This is a short form for Copy. This command is used to copy the files or directories from one place to another.

Example

cp source_file destination_file

This command will copy the contents of the source file into the destination file. If the destination file does not exist in the system, it will create one first and then copy the contents of the source file into it.

  • mv: This is a short form for Move. This command is used to move the files or directories from one place to another.

Example

mv source_file destination_file

This command will replace the name of the source file with that of the destination file that is given as an argument.

  • rmdir: This stands for Remove Directory. This command will remove each and every directory specified along with it in the command line, only if they are empty. If a directory is not empty, then it will not be removed. To remove a parent directory and its subdirectory, it is important to specify the subdirectory first so that after the subdirectory is removed, the parent directory becomes empty and can be removed.
  • rm: This stands for Remove. You can remove multiple files and directories by specifying their names along with this command. The command does not remove anything by default. We can also use this command as follows:
  • rm -r abc: When you specify the name of the directory after the rm command, it will not delete it if the directory is not empty. Using -r with rm will delete the non-empty directories as well.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
TechGuy

TechGuy

Tech enthusiastic, life explorer, single, motivator, blogger, writer, software engineer