YouTube Icon

Advanced CLI: Commands You Should Know as a Developer




Advanced CLI: Commands You Should Know as a Developer

No, in this article we won't go over the fundamental directions like ls, rm, and album. You shouldn't be stunned by observing those directions. You may even be very acquainted with them. Particularly in the event that you feel comfortable around the direction line really well. I accept you have in any event worked (or attempted to deal with) the direction line previously. In the event that you've never taken a shot at the order line, I propose you start by finding out about the rudiments. 

This article is for those of you who have some involvement in the direction line and experienced the fundamental directions. For the individuals who feel like it's a great opportunity to plunge further into the conceivable outcomes of working with the order line. I've recorded six directions for you in this article and incorporated a few hints at the base also.

1. wget

On Unix-like operating systems, the wget command downloads files served with HTTP, HTTPS, or FTP over a network. By default, it is included in all self-respecting Linux distributions.
The most simple way to use wget is to provide it with the location of a file to download over HTTP. Downloading the file http://xyz.com/static/images/banner.jpg with wget can be done by the following command:

wget http://xyz.com/static/images/banner.jpg

One great thing about wget is that it’s non-interactive, which means that it can run in the background while the user is not logged on. This allows you to start a retrieval and disconnect from the system, letting wget finish the work.

2. scp

Ever had a problem where you needed to have a file from a remote server on your local machine? Getting a file that a user uploaded that caused some trouble, for example.

Learn Ajax

You could download this file via the command line using the scp command. Scp is short for secure copy. But what’s even more important is that it’s a remote secure copy. This command is similar to the cp command that you probably already know, but either the source or the target is on another system.

The following command copies the file foobar.txt from a remote server to a local directory.

scp username@xyz.com:/path/to/foobar.txt /some/local/directory

But scp can also be used to copy a file from a local directory to a remote server.

The same can be done with directories using the -r option, which copies entire directories recursively.

3. ssh-keygen

The ssh-keygen command is used to generate a new SSH key pair. The public SSH key that is generated by this command can be used in Gitlab or Bitbucket to establish a secure connection.

Once you’ve added your SSH key to either Gitlab or Bitbucket, you won’t be prompted for a password every time you try to push your files to a remote branch.

To generate an SSH key pair, use the following command:

ssh-keygen -t ed25519

Note that in the example above, we used the ED25519 signing algorithm. While ED25519 is considered best practice, you should always do some research on the different available signing algorithms.

Generating the SSH key pair and setting it up correctly in Gitlab or Bitbucket costs you ten minutes at a maximum (probably more like three) but will be totally worth it!

4. chmod

According to Wikipedia, this is the definition of the chmod command. We’ve all been in a situation where a server didn’t have access to a certain file because of a misconfiguration in the file permissions.

Learn Ajax

The chmod command is fairly simple in itself, but giving the right permissions to files and directories is a whole different game.

chmod 664 robots.txt
chmod 775 public/images

The first example gives read and write permission to user and group for the robots.txt file. Read permission is granted to others for this file.

The second example gives read, write and execute permission to user and group for the public/images folder. Others are granted read and execute permission for this folder.

If you want to know more about setting the right permissions to files and directories, I suggest you read the Wikipedia page about chmod.

Learn Ajax

5. tar

The Linux tar stands for tape archive. It is used for collecting many files into one archive file. Tar is the most widely used command to create compressed archive files.

Let’s start with how you can create an archive file for a specific directory:

tar -cvf my-archive.tar /path/to/directory

This command will result in an archive file, called my-archive.tar, that contains all files of the /path/to/directory which is created in the current working directory.

Creating the archive file is part one. Part two consists of untarring the archive file, because at some point we want to use the files in the tar file. 

5 Significant Ways AI Can Boost the User Experience in Web Apps

6. alias

Everyone uses some commands that are a little too long or complex to completely remember. Luckily, you can create an alias for that command so you don’t have to remember the entire command.

alias short-command="your custom and very long command here"

Though creating an alias this way comes with one problem: This alias is temporary. If you create an alias this way, it will only be available for your current terminal session.

To keep aliases between sessions, you can save them in your user’s shell configuration profile file. This profile file is probably located at either ~/.bashrc or ~/.zshrc if you’re using Bash or ZSH, respectively.



Author Biography.

Lokesh Gupta
Lokesh Gupta

Overall 3+ years of experience as a Full Stack Developer with a demonstrated history of working in the information technology and services industry. I enjoy solving complex problems within budget and deadlines putting my skills on PHP, MySQL, Python, Codeigniter, Yii2, Laravel, AngularJS, ReactJS, NodeJS to best use. Through Knowledge of UML & visual modeling, application architecture design & business process modeling. Successfully delivered various projects, based on different technologies across the globe.

Join Our Newsletter.

Subscribe to CrowdforThink newsletter to get daily update directly deliver into your inbox.

CrowdforGeeks is where lifelong learners come to learn the skills they need, to land the jobs they want, to build the lives they deserve.

CrowdforGeeks

CrowdforThink is a leading Indian media and information platform, known for its end-to-end coverage of the Indian startup ecosystem.

CrowdforThink

Our mission is "Har Koi Dekhe Video, Har Ghar Dekhe Video, Ghar Ghar Dekhe Video" so we Provide videos related to Tutorials, Travel, Technology, Wedding, Cooking, Dance, Festivals, Celebration.

Apna Video Wala
CFT

News & Blogs

4e001a829dec0246019fc8cfbef37760.png

How to detect network connection is Online/Offl...

We all might be familiar with the JavaScript way of checking Online/ Offline status. But in the c...

f744dbf3ab03eaaa58fd3e6dac2d0169.png

How to Get User Country Name, Browser, OS Name,...

Using PHP get stoner details IP address country, device, cybersurfer, operating system  &nb...

ff7f9eca4d1a0d29656644f11b806865.png

How to Drag And Drop Data Between Two Tables In...

Introduction  occasionally you need to drag and drop data from one table to another table...

Top Authors

Lamia Rochdi is the Marketing Manager at Bell Flavors & Fragrances EMEA. A successful family-...

Lamia Rochdi

I’m Mertin Wilson a technician in a camera company and certified expert of different P...

Mertin Wilson

Zakariya has recently joined the PakWheels team as a Content Marketing Executive, shortly after g...

Zakariya Usman

Pankaj Singh is a Senior Digital Marketing Consultant with more than 2 years of experience in SEO...

Pankaj Singh
CFT

Our Client Says

WhatsApp Chat with Our Support Team