Debian is an open-source and lightweight operating system that is used by the community of software developers. Debian is the popular and one of the most used distributions of Linux that contains a lot of packages in its apt package manager. There are different tips and tricks that are helpful to the Debian users, these are discussed in this write-up.
Keep files/directories safe
Sometimes we keep the files on the computer which we do not want to share with others, such types of files can either be hidden. To hide the file from the other users, simply rename the file by using the “full stop” (.) before the file name. To understand it, we will create a directory using the command:
$ mkdir mydirectory
List down the components of the directory to verify the newly created directory:
To hide the directory, we will rename it by putting a (.) at the start of its name:
$ mv mydirectory .mydirectory
To view the files:
In the above output, the directory has been hidden.
Permanent deletion of files
If we want to delete files in Debian, we used the command of “rm” which only removes it from Debian, it can, later on, be recovered and can be seen by some other people. To make sure the file has been deleted permanently we used the command of “shred” along with the flags that are; z- which add the final overwrite to the file with zeros to hide it, u- to truncate after overwriting, and v- to display the progress. To understand this, we will delete the file, “myfile”:
$ shred -zvu myfile
Want to find some file
You saved a file/directory a few times ago, and now forgot where you save it? There is no need to worry, just use the command “find” in the directory where the file had been saved and type the name of the file:
$ find myimage.jpg
In the above command, we go to the directory of Downloads, and find a file with the name of “myimage.jpg”.
Display the details of files
To find out the details of the files available in the directory, we can use the command “ls” with the “l-flag”, for example:
$ ls -l
Freeze the terminal mistakenly
We use many shortcuts to save our time that’s why we are habitual of using a “CTRL+S” to save files in the editors, if by mistake we used this shortcut in the Debian terminal, it will freeze it and we cannot run any other command in the terminal. To unfreeze the terminal, use the “CTRL+Q” to unfreeze it:
Movement of cursor
After typing the command, if you want to add something at the start of the command, just press “CTRL +A” and the cursor will come at the start of the command:
Similarly, to return back the terminal, press “CTRL+E” to move the cursor to the end of the command:
Delete a complete line
To delete a complete line, we can use the shortcut of “CTRL+U”, to understand it, let us consider a command:
If we press the “CTRL+U”, it will delete the entire command till the cursor:
This is very helpful, if we type the wrong password and want to erase the password.
Reuse the previous command
To save time, instead of writing the previous command again, just type “!!” to use the previous command again:
If you need help with any command or tool, to understand its operation or use, use its manual, to open the manual, use the man command with that tool or service:
$ man sudo
To monitor the process
In the Linux, we can watch the output of the command by using the “watch” command to monitor the process of the output, for example if we use the it with the date command, then it can be used to monitor time:
$ watch date
Debian is the popular distribution of the Linux operating system, it has a lot of features, some of these tips and tricks are discussed in this article. These tips and tricks will help the Debian users to work on it efficiently and reliably.
The Best Linux Tutorials Website