This is an old revision of the document!
Table of Contents
Current Commands
Links
User management :
[FR] http://www.labo-linux.org/cours/module-1/chapitre-05-gestion-des-utilisateurs/
List
Command | Description |
---|---|
General | |
pwd | print the current path |
which <program> | print the path of the <program> |
Kernel modules | |
lsmod | list modules |
insmod nvidia / modprobe nvidia | insert the module (modprobe higher level) |
rmmod nvidia / modprobe -r nvidia | remove the module (modprobe higher level) |
Boot scripts (Gentoo) | |
rc-update show | list boot scripts |
rc-update add script.sh boot | add the script to the boot level |
Manage users | |
adduser -m -s /bin/zsh -g users cyril | add user cyril, ask creation of his home folder (-m), shell (-s), groups (-g) |
passwd cyril | change the password of user cyril (or yours if no user specified) |
groupadd <group> | add a group to the system |
/etc/passwd | contains UID of users, home directory and shell used |
/etc/shadow | contains crypted passwords of users |
/etc/group | contains groups GIDs and list of users in (you can edit it to add users to groups) |
userdel | delete user |
groupdel | delete group |
Manage permissions | |
chmod -R [u/g/o/a][+/-/=][r/w/x] <file(s)/folder(s)> | change permissions (user,group,other,all) |
chmod -R 0222 | change permissions (octal : rwx=1+2+4 / ugo) |
chown -R <owner>:<group> <file(s)/folder(s)> | change owner and group |
System | |
lspci | |
lsusb | |
lshw | |
File content manipulation | |
cat file | grep <string> | only print lines containing string (-e for regexp) |
grep -r <string> * | search recursively the string in all files |
cat <file> | cut -d “ ” -f 1,2,4-10 | only prints the given fields (-f), obtained with the given delimiter (-d), or the complement (–complement) |
cat <file> | sed 's/string1/string2/g | replace string1 by string2 (and a lot more with sed) |
cat <file> | tr '[:lower:]' '[:upper:]' | convert lowercase to uppercase (and a lot more with tr) |
cat <file> | wc -l | count number of lines (and a lot more with wc) |
recode iso-8859-15..utf8 <file> | convert encoding from latin9 to utf8 |
convmv -f iso-8859-15 -t utf8 -r <folder> | convert file names of files in folder from latin9 to utf8 |