Beruflich Dokumente
Kultur Dokumente
By Klaus Gugenberger
45
Linus Torvalds
nano – Texteditor
service networking restart – рестартира нетуъркинг сървиса кат смениш ИП адрес и т.н.
ip address – показва ип
du | df
man –a - All man pages in sequence with the given name in all chapters = apropos
Съдържание
Linus Torvalds .......................................................................................................................................... 1
List Installed Commands Here: (LICS) ...................................................................................................... 2
Start/Stop GUI ..................................................................................................................................... 3
vi – Текст едитор като Nano ................................................................................................................ 3
logical operators: ................................................................................................................................. 6
What is Sticky Bit? ................................................................................................................................... 7
How can I setup Sticky Bit for a Folder? .......................................................................................... 8
How can I setup SUID for a file? .......................................................................................................... 8
After setting SUID bit:...................................................................................................................... 9
What is Umask and How To Setup Default umask Under Linux?.......................................................... 10
Navigating the Directory History ....................................................................................................... 10
You can change the Bash Shell Colors links: ...................................................................................... 10
Shut Down PC Commands : ............................................................................................................... 10
Shells List: .............................................................................................................................................. 12
SSH Secureshell Verbindung.................................................................................................................. 12
Character Classes............................................................................................................................... 13
Recursive Copy: ................................................................................................................................. 14
Definition of Force: ............................................................................................................................ 14
Hard links ........................................................................................................................................... 14
Start/Stop GUI
sudo systemctl stop gdm (or sudo telinit 3)
and restart it (after logging into the console) with:
:w – Write to disk
:q -quit
rm -f <filename> - removes files or folders FORCEFULLY, Force means ignores nonexistent files and
arguments, never prompts for conformation
rm -rf Forcefully remove a directory recursively (Deletes all files and subfolders)
dd if=/dev/sda of=/dev/sdb – copy, format drives and partitions !!! if- Input file; of-Output
file.
lsblk – Shows all the Block Devices bs=4k means random numbers in 4k
blocks
apt-get remove autoremove – uninstalls libraries that were installed with other apps
http://links.twibright.com/user_en.html
This sets the myfile file's time stamp to 4 p.m., March 20th (03 20 1600).
watch (other command) – repeats other command every 2 sec -n 1 to change interval to 1
date [-s] - shows the system date (-s sets a new date)
logical operators:
ls && cal - if ls fails cal won’t execute
-x – extract
cat /etc/shadow – тука стои всичко, потребители пароли, етц. Моеш с лайв диск да се
ебаваш с паролите (хаш парола от друга система копи там и ше моеш да се логнеш на тая
система)
useradd – low level utility for adding users. Usually Admins use adduser instead. User is deactivated,
password must be set using passwd. Good for installing new services (DNS server controller account.
Has rights to control only the DSN server) od. MailAdmin.
useradd -m -s /bin/bash -g users
-m – Make Home Directory (Прай папка у Home)
Има някакво писано правило у Линукса да се пишат папките с Главна буква а данните с малка.
less und more – некви програми за отваряне на файлове като четец за текст…
Bits n Tits
Sticky Bit is mainly used on folders in order to avoid deletion of a folder and it’s content by other
users though they having write permissions on the folder contents. If Sticky bit is enabled on a folder,
the folder contents are deleted by only owner who created them and the root user. No one else can
delete other users data in this folder(Where sticky bit is set). This is a security measure to avoid
deletion of critical folders and their content(sub-folders and files), though other users have full
permissions.
sticky Bit – only the owner and root can delete, in ls -l shows as T
Symbolic way:
Numerical way:
chmod 1757 /opt/dump/
Here in 1757, 1 indicates Sticky Bit set, 7 for full permissions for owner, 5 for read and execute
permissions for group, and full permissions for others.
Numerical way:
chmod 4750 file1.txt
Here in 4750, four indicates SUID bit set, seven for full permissions for owner, five for read and
execute permissions for group, and no permissions for others.
Multiple slashes (/) between directories and files are allowed, but all but one slash between
elements in the pathname is ignored by the system. ////usr//bin is valid, but seen as
/usr/bin by the system.
Most of the time, it is most convenient to use relative paths, which require less typing. Usually, you
take advantage of the shortcuts provided by: . (present directory), .. (parent directory) and ~
(your home directory).
If you edit one of the files, exactly what happens depends on your editor; most editors,
including vi and gedit, will retain the link by default, but it is possible that modifying one of the
names may break the link and result in the creation of two objects.
ln - is used to create hard links and (with the -s option) soft links
What is Umask and How To Setup Default umask Under Linux?
https://www.cyberciti.biz/tips/understanding-linux-unix-umask-value-usage.html
You can setup umask in /etc/bashrc or /etc/profile file for all users. By default most Linux distro set
it to 0022 (022) or 0002 (002).
pushd . - saves current working directory into a list /does not work without a path (.)
https://www.cyberciti.biz/faq/bash-shell-change-the-color-of-my-shell-prompt-under-linux-or-unix/
cat Used for viewing files that are not very long; it does not provide any scroll-back.
tac Used to look at a file backwards, starting with the last line.
Used to view larger files because it is a paging program; it pauses at each screen full of text,
provides scroll-back capabilities, and lets you search and navigate within the file. Note: Use
less
/ to search for a pattern in the forward direction and ? for a pattern in the backward
direction. (An older program named more is still used, but has fewer capabilities.)
Used to print the last 10 lines of a file by default. You can change the number of lines by
tail doing -n 15 or just -15 if you wanted to look at the last 15 lines instead of
the default.
head The opposite of tail; by default, it prints the first 10 lines of a file.
apt-cache search ftpd* – Searches for an app in the app cache (if you know some of the name)
apt-cache policy <appname> - Shows app version and newest available version…
Wildcard Result
http – Port 80
shttp – Port 442 + Certificate
e-mails – Port 25
SCP – Port 22 Secure Copy Protocol
http://10.20.30.54/phpmyadmin
To get wordpress –
mands but also system administration commands, programming interfaces, file formats
and more. The table below describes the layout of the manual:
Character Classes
[[:class:]] Matches any character that is a member of the specified class
EXAMPLE:
*[[:lower:]123] Any file ending with a lowercase letter or the numerals “1”, “2”, or “3”
Recursive Copy:
cp dir1/* dir2 - Using a wildcard, all the files in dir1 are copied into dir2. dir2 must already
exist.
cp -r dir1 dir2 - Copy the contents of directory dir1 to directory dir2. If directory dir2 does
not exist, it is created and, after the copy, will contain the same contents as directory dir1.
If directory dir2 does exist, then directory dir1 (and its contents) will be copied into dir2.
Definition of Force:
-f, --force - Ignores nonexistent files and do not prompt. This overrides the –interactive
option.
rm -rf file1 dir1 - Same as above, except that if either file1 or dir1 do not exist, rm will
continue silently.
Be particularly careful with wildcards. Consider this classic example. Let's say you want to delete just
the HTML files in a directory. To do this, you type:
rm *.html
which is correct, but if you accidentally place a space between the “*” and the “.html” like so:
rm * .html
the rm command will delete all the files in the directory and then complain that there is no file called
“.html”.
Hard links
cannot span physical devices and hard links cannot reference directories, only files.
Setting up aliases
alias name='string' Example: alias lsl=’ls -cl’
> filename.txt – Creates an empty file
Using \ to print special characters:
The fact that a program can launch other programs is expressed in the process scheme as
131/155
Installing Package
233