LinuxAdminToolkitLinuxAdminToolkit
Home
Guide
About Me
GitHub
Home
Guide
About Me
GitHub
  • Administrator's Manual

    • Commands
      • Basic Commands
      • File Management
      • Process Management
      • User and Group Management
      • System Information
      • Disk Usage
    • Networking
      • IP Address
      • Subnetting
      • Routing
      • Firewall
      • Network Tools
    • Services
      • Service Management
      • Service Configuration
      • Common Services
    • Monitoring and Logging
      • System Monitoring
      • Log Management
      • Monitoring Tools
      • Log Analysis Tools
    • Shell Scripting
      • Basic Shell Script Structure
      • Variables
      • Control Structures
      • Functions
      • Input and Output
      • Debugging and Error Handling
      • Advanced Topics
    • Configurations Files
      • System Configuration Files
      • Network Configuration Files
      • Service Configuration Files
      • Application Configuration Files
      • Editing Configuration Files
      • Backup and Restore Configuration Files

File Management

cp (copy files and directories)

  • Copies files and directories.
  • '-r' is used for recursive copy.
cp source_file destination_file
cp -r source_directory destination_directory

mv (move/rename files and directories)

  • moves or renames files and directories.
mv old_name new_name
mv file_name /path/to/destination

rm (remove files and directories)

  • removes files and directories.
  • '-r' is used for recursive removal and '-f' is used for force removal.
rm file_name
rm -r directory_name
rm -f file_name

touch (create empty files or update timestamps)

  • creates an empty files or updates the timestamps of an existing files
touch new_file

cat (concatenate and display file contents)

  • displays the contents of the file
cat file_name

'more' and 'less' (view file contents)

  • views file contents and pagination.
  • less allows backward movement.
more file_name
less file_name

'head' and 'tail' (view beginning and end of the file)

  • head displays the first 10 lines by default, and tail displays the last 10 lines.
  • '-f' is used to follow a file (useful for logs)
head file_name
tail file_name
tail -f file_name
Edit this page on GitHub
Last Updated:
Contributors: jenilgajjar20
Prev
Basic Commands
Next
Process Management