Elias Degu
21 Mar 2022
•
3 min read
How to effectively use the computer terminal as a software developer.
It’s one thing to write computer programs but another to be a productive developer and use the computer the best way to ease your development workflow.
Today, If anyone needs to become a good developer, he or she must know how to use the computer terminal effectively as it saves tons of development time for them.
From downloading the image of the directory structure for a blog post to moving the files from one directory to the other, to transfer files from your computer to the server, and maintaining a server, today, everything happens with the command line.
Therefore it is vital to know these terminal commands.
This articles covers the top 12 terminal / Linux commands that would help technology enthusiasts better navigate the computer resources with the help of the command-line interface.
Have you ever wanted to get the directory structure of your folder in a tree-like layout? Then you are in luck! This command will help you achieve precisely that. You would need to install it in macOS. It is already available in Linux. brew install tree Go to the working directory and type the below command in the terminal tree
If you want to know anything about the terminal command itself from the below list, use the man command to get the official documentation of the command from the developers right in your terminal. man ls
The command helps you list out the contents in the directory. If you want to view hidden files too in the directory, use the additional -a argument. ls ls -a
The command lets you change the directory you are currently working in. cd [ Directory Name ] cd Desktop
Create a new file within the working directory with the touch command. touch [ filename ] touch index.js
Move the files from one directory to the other. It is by far the most practical command I use in my day-to-day work. Syntax: mv [ file-move-from ][ file-move-to ] mv ~/Downloads/file.txt ~/Documents/Work/file.txt
The command lets you copy the files from one directory to another. Syntax: cp [ file-source ][file-destination] Copy the contents of file-1 and file-2 into a new file. touch new.txt cp file-1.txt file-2.txt new.txt
It is also known as the search command in the terminal. It searches through a file and prints all the lines that match the given pattern. Syntax: grep [pattern][filename] touch index.js echo 'console.log('hello world')' >> index.js grep console index.js
View the stats of your system in the terminal with the help of this terminal command. It includes CPU utilization, disk storage information, memory by software programs. top
The cat command is the most convenient command for data engineers. Data Analysts use it to create files, view the contents of the files, merge two or more files into one, or even add data to the files. Yes, you can mix two or more excel or number files with this single command. Merge the content of all the files in the directory into one file. cat *.txt >> ~/Desktop/combined.txt Append the content of file-1 at the end of the contents of file-2. cat file-1 >> file-2 Create a file using the touch command and add a programming statement using the echo command. touch index.js echo 'console.log('hello world')' >> index.js
A developer can use this command to view the current public working directory in the system. It means to print the working directory. pwd
Use this command to view the contents of the CPU. It includes finding the cores in a system, its efficiency, and other related things about the computer CPU performance. lscpu is a Linux command. An alternate to it in mac OS is sysctl. lscpu Get the number of cores in your computer on Mac OS. sysctl -a | grep machdep.cpu.core_count
The above are the top twelve terminal commands that one can use to speed up the development process. One can also use it inside the programming language to create their own command-line interface apps. But the scope of it is beyond the content of this post. I will save it for some other day.
Elias Degu
See other articles by Elias
Ground Floor, Verse Building, 18 Brunswick Place, London, N1 6DZ
108 E 16th Street, New York, NY 10003
Join over 111,000 others and get access to exclusive content, job opportunities and more!