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

Essential Linux Commands Guide

The document discusses Linux commands for directories, files, processes and more. It covers commands like ls, cd, mkdir, rm, mv, cp, cat, more, less, head, tail, lpr, date, who, hostname, ps, kill and nice and their usage and functions.

Uploaded by

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

Essential Linux Commands Guide

The document discusses Linux commands for directories, files, processes and more. It covers commands like ls, cd, mkdir, rm, mv, cp, cat, more, less, head, tail, lpr, date, who, hostname, ps, kill and nice and their usage and functions.

Uploaded by

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

Linux Basics

Commands
l : long directory listing
a : lists all files, including files which are normally hidden
ls : lists the contents of a directory F : distinguishes between directories and regular files
h : ? Look it up using man

pwd : prints the current working directory

The difference between relative and absolute paths.


cd : changes directories Special characters ., .., and ~.

mkdir : creates a directory

rmdir : removes a directory (assuming it is If you get an error that the directory isn’t empty even though it looks
empty, check for hidden files.
empty)
• touch : creates an empty file with the specified
name, or if the file already exists it modifies the
timestamp.
• rm : removes a file.
• f : force deletion

Commands • r : recursive deletion


• mv - moves a file, or renames a file
• f : forces overwrite, if the destination file exists
• cp - copies a file, leaving the original intact
• f : forces overwrite, if the destination file exists
• r : recursive copying of directories
cat : shows the contents of a file, all at once

more : shows the contents of a file, screen by


screen

less : also shows the contents of a file, screen by


Commands screen

head : used to show so many lines form the top


of a file

tail : used to show so many lines form the


bottom of a file
• lpr : prints a file
• alias : creates an alias for a command.
• Aliases can be placed in your .cshrc login
script.
• Example: alias rm ‘rm –i’.
• date : shows the date and time on the current
Commands system
• who : used to print out a list of users on the
current system
• hostname : prints the hostname of the current
computer
• whoami : prints your current username
ps : lists the • ps -u username lists only your processes.
• ps -a : lists all processes running on the
processes machine.
running on • The PID column of the listing, provides the
information required by the kill command.
the machine.

• kill process_id : sends a terminate signal to the


kill : process specified by the process_id (PID).
Commands terminates a
process
• In cases where the terminate signal does not
work, the command "kill -9 process_id" sends
a kill signal to the process.

nice : runs a
process with a
lower priority.

You might also like