Certainly! Here are some useful Linux commands that can help you manage files, directories, and system information:
-
List Files and Directories:
lsUse
ls -lfor detailed information andls -ato include hidden files. -
Copy Files:
cp source_file destination -
Move/Rename Files:
mv old_name new_name -
Remove Files:
rm filenameUse
rm -r directory_nameto remove a directory and its contents. -
Create a Directory:
mkdir directory_name -
Change File Permissions:
chmod permissions filename -
View File Contents:
- Use
cat filenameto display the entire file. - Use
less filenameormore filenamefor paginated viewing.
- Use
-
Search for Text in Files:
grep 'search_term' filename -
Find Files:
find /path/to/search -name 'filename_pattern' -
Display Disk Usage:
df -h -
Check Memory Usage:
free -h -
View Running Processes:
ps auxUse
toporhtopfor a dynamic view of processes. -
Download Files:
wget http://example.com/file -
Archive and Compress Files:
- Create a tarball:
tar -cvf archive_name.tar directory_name - Extract a tarball:
tar -xvf archive_name.tar
- Create a tarball:
-
Check System Information:
uname -a
These commands are fundamental for navigating and managing a Linux system effectively.
