Terminal Hacks! Some basic Linux Commands.

Himanshi Agrawal
2 min readDec 6, 2020

Hi, there!

So terminal/shell whatever you call it could be a big deal if you are not aware of some basic commands especially when you are working on Linux or Mac.

Well, I started my work with minimal knowledge of Terminals. Everything was new to me & all in all lot of things to grasp at one go. At that point of time terminal/shell commands seems dispensable to me as I was good to go with commands like cd, mkdir, cp, ls etc.

But but but…. little did I realise that my efficiency & productivity was getting affected because I didn’t know the benefits of learning some good Linux commands. Moreover, it’s a daunting scenario when you gotta perform your stuff in front of an experienced person but without using terminal notably.

So let’s go through some really basic commands which a person should know before he thinks he is a “Developer”.

  • clear: clear the mess form your screen.
  • uname: prints the details of the current machine example OSdetails. Use -r and -a for more elaborative details. -r basically refers to ‘recursive’ & ‘-a’ for all.
  • history: gets you history of commands ran on terminal.
  • ls: list the content in current directory.
  • pwd: prints the current directory path.
  • cd: it’s a catch directory & helps to hop on other directories.
  • cd ~: gets you to user directory, doing pwd there will o/p something like /Users/<user_name>/
  • cd /: prints the root directory, contains all the directories & files of system.
  • touch <file_name.ext>: creates the desired file in current dir.
  • apt-get: they are like managers of Linux(yum for centos, brew for mac) for updating & upgrading system. Eg: apt-get update && apt-get upgrade.
  • rm <file_name>: Used to remove file.
  • rmdir <dir_name>: Used to remove directory.
  • man <cmd>: print details of cmd, eg- man ls.
  • cp <file to be copied> <destination path>: use to copy files.
  • mv <file> <destination path>: move file to destination.
  • chmod: very powerful command to modify permissions of file/dir. eg- chmod 764 <filename>
  • chown: use to change owners of file/dir. eg- chown user:user_group file.
  • zip: use to compress files. eg- zip <zip_name> <files to be zipped><files>….
  • vim/vi: they are editing tools for modifying files. eg: vim <filename>

Apart from these, there are lot other commands, also you will find some hyphens eg: -r, -a, -rf, -ll, -la etc for sufficing other utilities. Do look on them also for more verbose nature of commands.

Happy linuxing!

--

--