More useful terminal commands for GNU/Linux

89

In a previous short article we talked about some very simple commands for persons to understand to do in a Linux terminal like transforming directories, or copying data files.

These days, I’ll be displaying you some more helpful matters the terminal newbie may possibly or may possibly not know how to do, like renaming data files, shutting down and rebooting your device, or scheduling a shutdown/reboot at a distinct time.

How to rename data files

Simply set, renaming data files is not carried out like it is in other methods, we are not definitely renaming the file, we are going to move the file, giving it a new name in the course of action. To do this, we need to use the command for relocating:

  • mv X Y

As talked about in our previous short article, mv is the command utilised to move data files from position A to position B. This can be carried out from in just any directory, to any directory, even if you are not now located in the director that the file is contained in.

For instance

  • sudo mv ~/myfile /var/log/someprogram/logfiles/morefolders/myfile2.log

The over command moves the file ‘myfile’ out of the end users residence directory and spots it into a subfolder of the /var/log directory, below the new name ‘myfile2.log’

Notice: The sudo preface was utilised, due to the fact you just can’t move a file to /var/ without having it, sudo is not necessary to utilizing the mv command if you remain out of directories that call for root entry.

Relocating a directory is the same concept:

  • mv ~/test1 ~/Documents/test2

This command will move the directory ‘test1’ into the Documents folder below the new name ‘test2’, and will not change the names or have an impact on the data files in just that document, retaining them securely intact.

Shutting down and restarting your device

If you are utilizing a modern day distribution then shutting down and rebooting never even need root entry (with most distributions) any longer – helpful!

Shutdown More useful terminal commands for GNU/Linux

Shutting down is as very simple as typing:

  • shutdown

To which you will acquire a information equivalent to:

Shutdown scheduled for Thu 2017-09-28 11:forty nine:59 EDT, use ‘shutdown -c’ to cancel.

And definitely if you want to cancel:

  • shutdown -c

Rebooting your Computer system is just as very simple:

  • reboot

Carried out!

However….There are more advanced matters we can do with these commands…

  • shutdown -h XX:XX

This command will immediately shut the device down at the specified time, in 24-hour format. Switch X with the suitable quantities, and you are carried out.

  • shutdown -r XX:XX

This will do the same point, but will reboot the device at the specified time.

Closing phrases

So there you have a couple of more neat tiny recommendations and tricks for when you are in a textual content surroundings, good for remote servers, or if you are in a hurry, as I individually discover it more rapidly to basically use the various commands, alternatively than clicking all-around an interface.

Ghacks desires you. You can discover out how to aid us below or aid the web-site directly by becoming a Patreon. Thank you for becoming a Ghacks reader.

The put up Extra helpful terminal commands for GNU/Linux appeared very first on gHacks Technological know-how Information.

Supply