SEARCH

 


Linux Commands

Man
Which
Whereis

Invoking Programs
Linux OS Directories

Mounting & UnMounting Devices
Searching for Files
CPU Information & Stats

System Commands in /bin
System Commands in /etc
System Commands in /sbin
System Commands in /usr/bin
System Commands in /usr/sbin

 

How can I empty a file?

Issue the following command to empty a file that currently exists:

cp /dev/null <filename>

How can I see how large a folder is on the system?

Issue the following command to see how large a folder is and the files it contains:

du -h <folder_name? -size

How can I find out how many files are within a specific folder?

ls | wc -l

How can I copy all the contents of one folder into another?

cp -r <dir1> <dir2>

How can I delete all of the files in a folder and the folder itself?

rm -r <dir>

How can I remove all files older than 7 days?

find \ (-name '*' \) -atime +7 -exec rm {}\

Just the change the +7 to a specific number of days if required.