Lect99 - Example papers Flashcards
(95 cards)
The /proc directory is a location for
Virtual file system for process and kernel information
The /etc directory is a location for
Configuration files
The passwd file can be found in
/etc
To transfer ownership of the file toto from dave to nicola type
chown nicola toto
The /etc/services file contains
a list of port mappings for the system (tcp and udp)
To set the read, execute permission of the file toto for group and other type
chmod 755 toto
In an Ubuntu system, the command sudo apt-get dist-upgrade is used to
Upgrade an existing installation and add new packages if needed.
To identify which shell an user is using, (s)he looks in
/etc/passwd (shows default shell)
The command ls -lh is used to show:
a long listing of a file or directory of files, including permissions mod time and size in human readable format.
The /bin directory is a
directory for common executables
The /sbin directory is a location for
for system executables usually used by root
To view the boot message from the kernel type:
dmesg
To show the IP address of the current host, type:
ifconfig
The command ls [t][ne]* is used to list:
files that start with the letter t followed by either an n or e
The /usr directory is a
user binaries, libraries and other software (the majority of the system is in here)
The command cat /etc/passwd | egrep /bin/bash is used to show:
entries in /etc/passwd that contain the string /bin/bash
To run a command vi as root, type:
sudo vi or su – vi
To extract the usernames of all users on your system from /etc/passwd type:
cat /etc/passwd | awk -F’:’ ‘{print $1}’ cat /etc/passwd | cut -d’:’ -f1
To count the lines in a file toto, type:
cat toto | wc -l
To print the result of the command who to a file users.txt, type:
who > users.txt
Change to home directory
cd /home cd ~
Move a file
mv file /destination/file
Delete lines 2 to 3 of a file called toto
sed -e ‘2,3d’ toto
Create a directory tata
mkdir tata