Here are some other useful Linux commands:
-
List files and directories:
lsUse
ls -lfor detailed information andls -ato include hidden files. -
Change permissions:
chmod [permissions] [file]Example:
chmod 755 myfilechanges the permissions ofmyfile. -
Copy files:
cp [source] [destination]Example:
cp file.txt /path/to/destination/. -
Move or rename files:
mv [source] [destination]Example:
mv oldname.txt newname.txt. -
Remove files:
rm [file]Use
rm -r [directory]to remove a directory and its contents. -
View file contents:
cat [file]Use
less [file]ormore [file]for paginated viewing. -
Search for text in files:
grep [pattern] [file]Example:
grep "search term" myfile.txt. -
Display disk usage:
df -hThis shows disk space usage in a human-readable format.
-
Check memory usage:
free -hThis displays memory usage statistics.
-
Get help for a command:
man [command]Example:
man lsshows the manual for thelscommand.
These commands are fundamental for navigating and managing files in a Linux environment.
