Ubuntu Server

Command Line

1. At a glance

2. File Management

ls -a [path]
/hidden files

ls -l [path/file]
/list permissions

ls [path/file] | wc -l
/count files in directory

cat [existing-file]
less [existing-file]
more [existing-file]
/view file

cat > [filename]
touch [filename]
/create new file

mkdir [directory-name]
/create directory

rm [filename]
/remove file
rm -d [directory-name]
/remove directory
rm -r [directory-name]
/remove directory and contents

mv [path/file] [new-path]
/move file
mv [file] [rename-file]
/rename file

cp [path/file] [new-path]
/copy file

find / -type f -name [filename]
/find file - search all locations
find . -type d -name [directory-name]
/find directory - search working directory

vi [filename]
/view and edit file

3. System Management

4. Package Management

5. Networking

6. Users & Permissions

7. Storage

8. Security

9. Logs & Monitoring

10. Packet Capture

> s"> /html>