0% found this document useful (0 votes)
7 views6 pages

Linuxc

Uploaded by

dyumnar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views6 pages

Linuxc

Uploaded by

dyumnar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

These notes provide a comprehensive overview of the Linux commands covered in the video "60

Linux Commands you NEED to know (in 10 minutes)" by NetworkChuck, drawing directly from the
transcript provided.

Full Notes on Linux Commands

The video aims to introduce 60 essential Linux commands in 10 minutes, covering a wide range of
functionalities from file management to networking and system administration.

1. Connecting & Navigation

 SSH: Used to connect to your Linux machine.

o Usage: Specify your user ID, followed by the @ symbol, and then the server's IP
address or hostname. For example, user@server_ip_address. After entering, you'll
accept fingerprints and input your password.

 LS: Lists all files in your current working directory.

o Switches:

 -L: Provides a detailed list (long format).

 -A: Shows hidden files (those starting with a dot).

 PWD: Prints the working directory; tells you your current location in the file system.

 CD: Change directory.

o Usage:

 cd /path/to/directory: Navigates to a specific path.

 cd ..: Jumps back one directory level.

 cd (with no arguments): Takes you back to your home directory.

2. File Creation, Editing & Viewing

 Touch: The quickest way to create a file.

o Usage: touch filename. You can create multiple files by listing names: touch file1
file2 file3.

o Switches:

 -D: Create a file with a specified future date.

 Echo: Allows you to display text or add content to a file.

o Usage: echo "text to add" > filename. The > symbol directs the output to a new or
existing file.

 Nano: A simple text editor for files.

o Usage: nano filename.

o Saving: To save your file, hit Control + X, then Y (for yes), and then Enter.
 Vim: A powerful, more advanced text editor.

o Usage: vim filename.

o Editing: Hit I to start inserting text.

o Saving & Quitting: Once done, hit Escape, then type :wq (write and quit), and hit
Enter.

 Cat: Quickly displays the content of a file.

o Usage: cat filename.

 Shred: Securely deletes a file, making its content unreadable.

o Usage: shred filename. After shredding, cat will show nothing.

 Less: Reads a file one page at a time, useful for large files.

o Usage: less filename.

 Head: Shows the beginning of a file.

o Usage: head filename.

 Tail: Shows the end of a file.

o Usage: tail filename.

3. File & Directory Management

 MKDIR: Makes a new directory.

o Usage: mkdir directoryname.

 CP: Copies a file.

o Usage: cp source_file destination.

 MV: Moves or renames a file.

o Usage: mv source_file destination.

 RM: Removes or deletes a file.

o Usage: rm filename.

 RMDIR: Removes an empty directory.

o Usage: rmdir directoryname.

o Note: If the directory is not empty, you need to use rm -R (recursive delete) with the
directory name.

 LN: Creates a link to a file.

o Usage: ln -s original_file link_name. The -s switch creates a soft (symbolic) link.

4. User & Permissions Management

 Whoami: Tells you the name of the current user.


 Adduser: Creates a new user.

o Usage: adduser username. This command requires sudo (superuser do) permissions.
It allows setting parameters like passwords.

 Sudo (psdo): Allows a permitted user to execute a command as the superuser or another
user.

o Usage: sudo command. You will be prompted for your sudo password.

 SU: Switch user.

o Usage: su username: Switches to the specified user.

 Exit: Exits the current shell session or user session.

 Passwd (P A S S W D): Changes a user's password.

o Usage:

 passwd username: Changes the password for a specific user (requires sudo
for other users).

 passwd: Changes your own password.

 Chmod (CH mod): Changes file attributes, specifically permissions.

o Usage: chmod +x filename: Makes a file executable.

 Chown (CHONe): Changes the ownership of a file.

o Usage: chown user filename: Transfers ownership to the specified user.

5. System Information & Utilities

 Clear: Clears the terminal screen.

 Finger: Inspects another user's information.

o Usage: finger username. This command usually needs to be installed first.

 Uname: Displays basic system information.

o Switches:

 -A: Shows a lot more system information (all information).

 Neofetch: Provides a "prettier" display of system information.

o Installation & Usage: Requires installation (sudo apt install neofetch), then simply
run neofetch.

 Cal: Displays a calendar.

o Installation: Can be installed with sudo apt install ncal if not present.

 BC (bc): A command-line calculator.

o Usage: echo "math problem" | bc: Pipes the problem into bc to get the answer.

 Free: Checks system memory usage.


o Usage: free: Shows used, available, and swap memory.

 DF: Reports disk space usage.

o Switches:

 -H (capital H): Displays disk space in human-readable format (e.g., GB, MB).

6. Package Management

 APT (A P T): The package manager for Debian-based Linux distributions (like Ubuntu).

o Update Repositories: sudo apt update: Must be run before installing new packages
to update the list of available software.

o Install Packages: sudo apt install package_name: Installs the specified package.

 Yum: The package manager used on Red Hat or CentOS systems.

7. Getting Help

 Man: Consults the manual page for a command.

o Usage: man command_name: Displays detailed information about the command


and its usage. Hit Q to quit the manual page.

 Whatis: Provides a quick, one-line description of a command.

o Usage: whatis command_name.

 Which: Shows the full path of an executable command.

o Usage: which command_name.

 Whereis: Shows the location of a command's binary, source, and manual pages.

o Usage: whereis command_name.

8. Networking

 Ifconfig: Displays IP address and network interface configuration.

o Note: May need to be installed.

 IP address: A more modern command for displaying network interface information.

 Grep (GR grip): Filters text, often used with pipes (|) to search for specific patterns within
the output of another command.

o Usage: command | grep "pattern". For example, ip address | grep "eth0" to see only
eth0's IP.

 AWK (A A): A powerful text processing tool, even more capable than grep, used for pattern
scanning and processing.

o Usage: Often used after grep with pipes to extract highly specific data like an IP
address using regular expressions.

 Cat /etc/resolv.conf: One way to check DNS server information, though it might not be very
informative on newer Ubuntu versions.
 Resolvectl status: A better way to check DNS status on newer Linux distributions like
Ubuntu.

 Ping: Checks if a host (like a website) is reachable on a network.

o Usage: ping website_name. It sends responses forever until stopped.

o Stopping: Hit Control + C to stop.

o Switches:

 -C count: Limits the number of packets sent (e.g., ping -c 5 google.com).

 Can also specify the size of packets.

 Traceroute: Shows the path (hops and latency) through the internet to a specified website.

o Usage: traceroute website_name.

 Netstat (net Statistics): Displays network connections, routing tables, interface statistics,
etc., to check open ports.

o Usage: netstat -tulpn: Useful switches to display TCP/UDP listeners, numeric


addresses, and program names.

 SS: A more modern and faster alternative to netstat for displaying socket statistics.

o Usage: Similar switches to netstat (e.g., ss -tulpn) for network information.

 UFW (U F W): Uncomplicated Firewall, simplifies firewall management over direct iptables.

o Allow Port: sudo ufw allow 80: Allows traffic on port 80.

o Check Status: ufw status: Shows the current firewall status and allowed/denied
rules.

o Enable Firewall: ufw enable: Activates the UFW firewall.

9. Process Management

 PS: Displays information about running processes.

o Switches:

 aux: Shows all processes (a), including those not attached to a terminal (u),
and with full user format (x).

 Top: Provides a real-time, dynamic view of running processes, CPU usage, memory, etc..

 Htop (H top): A more interactive and visually appealing version of top.

 Kill: Sends a signal to a process, typically to terminate it.

o Usage: First, find the Process ID (PID) using ps and grep.

o kill -9 PID: Forcibly kills a process using signal 9 (SIGKILL).

 Pkill: Kills processes by name or other attributes without needing to know the exact PID.

o Usage: pkill -f process_name_part: Kills processes matching the specified name.


 Systemctl (system CTL): Manages system services (daemons) on systems using SystemD.

o Stop Service: sudo systemctl stop service_name.

o Start Service: sudo systemctl start service_name.

o Check Status: systemctl status service_name.

o Restart Service: sudo systemctl restart service_name.

 Service: Used to manage services on older Linux systems that do not use SystemD.

10. System Control

 History: Displays a list of previously executed commands.

 Reboot: Restarts the system.

o Usage: sudo reboot.

 Shutdown: Shuts down the system.

o Usage:

 sudo shutdown: Shuts down the machine in about one minute.

 sudo shutdown -h now: Shuts down the machine immediately.

Additional Information from the Video

The video is sponsored by Linode, which allows users to spin up quick virtual machines for as low as
0.01 cents per hour for various tasks. The cost is only for the time the machine is active, and you can
destroy it when done.

You might also like