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 destinationMove/Rename Files:
mv old_name new_nameRemove Files:
rm filenameUse
rm -r directory_nameto remove a directory and its contents.Create a Directory:
mkdir directory_nameChange File Permissions:
chmod permissions filenameView File Contents:
- Use
cat filenameto display the entire file. - Use
less filenameormore filenamefor paginated viewing.
- Use
Search for Text in Files:
grep 'search_term' filenameFind Files:
find /path/to/search -name 'filename_pattern'Display Disk Usage:
df -hCheck Memory Usage:
free -hView Running Processes:
ps auxUse
toporhtopfor a dynamic view of processes.Download Files:
wget http://example.com/fileArchive 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.
