How to check the amount of free space in a server?
Answer:
df -h
will print out the information you want.
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
How to check the amount of free space in a server?
Answer:
df -h
will print out the information you want.
How to delete a folder in Linux recursively?
Answer:
As an example, to remove all files/folders recursively under /home/john/tmp, use the command:
rm -rf /home/john/tmp
How to count the number of files in a directory?
Answer:
If you are only interested in know the number of files in a directory, try the command:
find /home/john -type f | wc -l
How to resolve the '/bin/rm: Argument list too long' error
Answer:
Use the xargs command, e.g.
find . -name '*' | xargs rm
The above command will find all files in the current directory and pipe the filename to xargs for using rm to removing them.
Massively rename files in Linux?
Answer:
Use the rename command.
Example: Remove the word "DSC" from all jpg files.
rename 's/DSC//' *jpg