Change to the home directory in Linux
Answer:
To quickly change to the current user's home directory in Linux, you just need to remember the commabd cd ~
E.g.
# cd ~
pwd
/home/john
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
Change to the home directory in Linux
Answer:
To quickly change to the current user's home directory in Linux, you just need to remember the commabd cd ~
E.g.
# cd ~
pwd
/home/john
How to list directories in Linux?
Answer:
To list directories in Linux using command.
# ls -d /tmp
Copy file to remote server using scp
Answer:
To copy file from local machine to remote server, it is easy with scp
e.g.
# scp test.txt john@remoteserver:/home/john/
The above command copy the file test.txt to the remote folder /home/john, of the machine remoteserver.
Rename directory in Linux
Answer
The easiest way to rename a directory in Linux is to move the directory , using the mv command.
e.g.
# mv old_directory new_directory
Install mlocate for quick file search in Linux
Answer:
mlocate is a useful tool for quickly find files on the filesystem based on their name.
To install
# sudo apt-get install mlocate
After install, you would need to build the database for the first time
# sudo updatedb&
Now the database building/indexing is running in the background, when it is finished, you can use the locate command to lookup file in your filesystem.
# locate SHA1.pm
/usr/lib/perl5/Digest/SHA1.pm