Comenzi linux uzuale
zip archivefile1 doc1 doc2 doc3
This command creates a file “archivefile1.zip” which contains a copy of the files doc1, doc2, and doc3, located in the current directory.
zip archivefile1 *
This command creates a file “archivefile1.zip” which contains a copy of all files in the current directory in compressed form. However, files whose name starts with a “.” are not included. The extension “.zip” is added by the program.
zip -r archivefile1 .
This copies the current directory, including all subdirectories into the archive file.
zip -r archivefile2 papers
This copies the directory “papers”, located in the current directory, into “archivefile2.zip”.
This writes the files extracted from “archivefile1.zip” to the current directory.
tar cvf alldocs.tar *.doc
To create an archive using tar, use a command like this, which bundles all the files in the current directory that end with .doc into the alldocs.tar file
tar cvf panda.tar panda/
Creates a tar file named panda.tar containing all the files from the panda directory (and any of its subdirectories)
In these examples, the c, v, and f flags mean create a new archive, be verbose (list files being archived), and write the archive to a file.
tar cvzf alldocs.tar.gz *.doc
To automatically compress the tar file as it is being created, add the z flag.
tar xvf panda.tar
Extract files from panda.tar. To extract the contents of a tar file, use the x (extract) flag in a command.
tar xvfz panda.tar.gz
Extract files from panda.tar.gz
c Create a new archive.
t List the contents of an archive.
x Extract the contents of an archive.
f The archive file name is given on the command line (required whenever the tar output is going to a file)
M The archive can span multiple floppies.
v Print verbose output (list file names as they are processed).
u Add files to the archive if they are newer than the copy in the tar file.
z Compress or decompress files automatically.
useradd -G group-name username
Adaugă user nou la un grup existent.
usermod -a -G group-name username
Adaugă un user existent la un grup existent.
useradd -g group-name username
Adaugă un user nou cu grup primar.
usermod -g group-name username
Modifică grupul primar al userului.