Linux File Management

File Management

To search for a file by name

First run “updatedb” This updates files index on the system.
updatedb

Once this is done find a file use the locate command
locate filename 
 

Copying, Moving, renaming files

Move a file to a directory 

mv
mv test test2 simply moves test to the test2 file, note its like renaming it. 
 

Copy a file. You can copy a file to a directory and also rename it while copying 

cp filename /etc/filename
cp can also be used to copy directories. Example cp -r /root/mail /usr/local 
-f will force the copy
-p will copy permissions
 

Make a directory 

mkdir
mkdir can make a directory anywhere ex mkdir /etc/sysconfig/testdir 

Remove a file and can also be used to rm directories 

rm

To remove an entire directory and its contents, type rm -rf /directory where "/directory" is the path to the directory that you want to delete.
rm -Rf /root removes everything in your /root directory without prompts, DON'T DO THIS!!!! 
 

Remove empty directories

rmdir

touch creates an empty file 
touch

Enabling FTP

Turn FTP on You need to modify the /etc/inetd.conf with an ftp line like below 

ftp     stream  tcp     nowait  root    /usr/sbin/tcpd  in.ftpd

Have a Linux Problem
Linux Forum - Do you have a Linux Question?

Linux Books
Linux Certification, System Administration, Programming, Networking Books

Linux Home: Linux System Administration Hints and Tips

(c) www.gotothings.com All material on this site is Copyright.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
All product names are trademarks of their respective companies.
The site www.gotothings.com is in no way affiliated with or endorsed by any company listed at this site.
Any unauthorised copying or mirroring is prohibited.