Docsity

Linux Commands - Cheat sheet, Schemi e mappe concettuali di Fondamenti di informatica

Toggle sidebar
bg1
ls
List command, it will show you the
full list or content of your directory.
cd
cd [directory_name]
It is used to change the current
working directory.
pwd
It prints out the shell’s current
working directory. Dove sono.
--help
It gives a short help text message for
each command it follows.
mkdir
mkdir [options..] [directories..]
It allows the user to create
directories and set the permissions.
You need to have enough
permissions.
rmdir
rmdir [options..] [directories..]
It allows the user to delete empty
directories.
touch
touch [options..] [directories..]
It allows the user to create an empty
file or to modify the timestamps of a
file.
rm
rm [options..] [directories..]
It removes objects such as files from
the file system.
mv
mv [options..] [source_file_name]
[destination_file_name]
It renames file directories and
moves files from one location to
another.
cp
cp [options..] [source_file_name]
[destination_file_name]
It is used to copy files or groups of
files or directories.
head
head [options..] [file_name]
It prints the first N lines of a given
file.
tail
tail [options..] [file_name]
It prints the last N lines of a given
file.
less
less [options..] [file_name]
It reads the contents of a text file one
page at a time.
more
more [options..] [file_name]
It reads the contents of a text file one
page at a time. Similar to less but with
fewer options.
cat
cat [options..] [file_name] + a few additional tricks
• Read text file and view on
screen
• Create a new text file
• File concatenation
• Modifying file
• Combining text or binary files
date
date [options] [+ format]
It allows us to generate a date
according to an input format string.
chmod
chmod [options] [mode] [file_name]
It is used to change permissions to
files and directories.
ls -l
To see all the permissions that a
particular file has.
chown
chown new_owner file_name
It changes the owner of a given
file/folder.
id
Command used to check if the current
user is a superuser.
sudo
sudo [options] command
To temporarily become a superuser.
adduser
adduser new_user_name
It is used to add users. You can use it
only if you have superuser privileges.
find
find [options] [path] [expression]
It is used to walk a file hierarchy.
find -name MyFile.txt
Search for a file with a specific name.
deluser
deluser username
It is used to delate a user. You can
use it only if you have the superuser
privileges.
zip
zip [options] [file_name.zip] [files_names]
unzip [options] [file_name.zip] [files_names]
It is used to reduce a file size.
tar
tar -[options] [file_name.zip] file_names
wget
wget [options] url
In order to get a text from the web.
pf2

Anteprima parziale del testo

Scarica Linux Commands - Cheat sheet e più Schemi e mappe concettuali in PDF di Fondamenti di informatica solo su Docsity!

ls List command, it will show you the full list or content of your directory. cd cd [directory_name] It is used to change the current working directory. pwd It prints out the shell’s current working directory. Dove sono. --help It gives a short help text message for each command it follows. mkdir mkdir [options..] [directories..] It allows the user to create directories and set the permissions. You need to have enough permissions. rmdir rmdir [options..] [directories..] It allows the user to delete empty directories. touch touch [options..] [directories..] It allows the user to create an empty file or to modify the timestamps of a file. rm rm [options..] [directories..] It removes objects such as files from the file system. mv mv [options..] [source_file_name] [destination_file_name] It renames file directories and moves files from one location to another. cp cp [options..] [source_file_name] [destination_file_name] It is used to copy files or groups of files or directories. head head [options..] [file_name] It prints the first N lines of a given file. tail tail [options..] [file_name] It prints the last N lines of a given file. less less [options..] [file_name] It reads the contents of a text file one page at a time. more more [options..] [file_name] It reads the contents of a text file one page at a time. Similar to less but with fewer options. cat cat [options..] [file_name] + a few additional tricks

  • Read text file and view on screen
  • Create a new text file
  • File concatenation
  • Modifying file
  • Combining text or binary files date date [options] [+ format] It allows us to generate a date according to an input format string. chmod chmod [options] [mode] [file_name] It is used to change permissions to files and directories. ls - l To see all the permissions that a particular file has. chown chown new_owner file_name It changes the owner of a given file/folder. id Command used to check if the current user is a superuser. sudo sudo [options] command To temporarily become a superuser. adduser adduser new_user_name It is used to add users. You can use it only if you have superuser privileges. find find [options] [path] [expression] It is used to walk a file hierarchy. find - name MyFile.txt Search for a file with a specific name. deluser deluser username It is used to delate a user. You can use it only if you have the superuser privileges. zip zip [options] [file_name.zip] [files_names] unzip [options] [file_name.zip] [files_names] (^) It is used to reduce a file size. tar tar - [options] [file_name.zip] file_names wget wget [options] url In order to get a text from the web.

file file [options] filename It allows you to determine the actual type of the file independently on the extension. wc wc [options] filename It allows you to count newline, word, and byte of a given file. tr tr [options] set1 set2 Translating or deleting characters. sort sort [options] file_name It is used to sort a file , arranging the records in a particular order and print out the results on stdout. uniq uniq [options] [input [output]] It finds the unique lines in a given input and either reports or removes the duplicates lines. grep grep [options] patterns [file] It is used to search for a string of characters in a specified file and print out the results. sed sed [options] … [script] [input_file..] It can be used to modify files. awk awk [options] ‘program’ input-file1 input-file It is used for extracting and manipulating data from text files. ps You can determine your shell type. scp scp [options] [source] [destination] It is used to securely copy files and directories between remote and local systems.