Chapter 3 Answers to Exercises in Section 3.6
3.6.1. Partitions
- Look in /etc/fstab or use df to see if /home is mounted on separate partition.
-
- to see all partitions on the computer
fdisk -l
- to see all mounted partitions
df
-
fdisk -l | grep ^/ | wc -l
- Add up the used space on partitions found from
df -h
- First eliminate all /media directories with umount and then:
3.6.2. Paths
-
echo $PATH
- This gives no
ls command.
-
- /home/username
-
cd ../myusername
-
cd /var/tmp
-
cd /usr/share
cd doc
pwd
3.6.3. Tour of the system
1. cd /proc
2. less cpuinfo
3. less meminfo
4. less swaps
5. less modules
6. cat uptime
7. less filesystems
man proc
- Refer to the man page of
proc for more info about these files
11. cd /etc
12. remove question
13. remove question
14.
less issue
less motd
15. Note: for just the normal users, check for bash with the second command
wc -l /etc/passwd
grep bash /etc/passwd |wc -l
16. wc -l /etc/group
17. /etc/timezone
18. find /usr -iname “*howto*”
19. cd /usr/share/doc
20.
cd /usr/share/doc/coreutils
less README
or
info coreutils
21. From man bash: bash –version
3.6.4. Manipulating files
-
cd ~
mkdir newdir
- No
-
mv newdir
/home (error: Permission denied)
-
-
cd /usr/share/pixmaps
cp *.xpm ~/newdir
- With this command several programs are listed indicating that XPM is X PixMap
apropos xpm
-
ls -r
-
mkdir ~/newdir2
cp -r /etc/* ~/newdir2
- Note that you will probably be denied permission to some of /etc
-
cd ~/newdir2
mkdir Upper lower
find . -name "[A-Z]*" -exec mv {} Upper \;
find . -name "[a-z]*" -exec mv {} lower \;
-
find . -name "[!a-zA-Z]*" -exec rm {} \;
-
rm -rf ~/newdir2
- Nothing found. Tried with xfs, server and font. No separate font server?
cd /etc/init.d
grep font * |grep server
- sendmail not found. Most systems now use exim or postfix.
which sendmail
locate sendmail
-
ln -s /var/tmp ~/mytmp
ls ~/mytmp (will see the contents of /var/tmp
-
cd ~
ln -s mytmp mynewtmp
rm mytmp
ls
- mynewtmp is now red on black indicating a broken link
3.6.5. File permissions (Warning: Do not do these as root or with sudo)
- Only on the directory that you own-your home directory
-
umask
- You cannot do this as normal user
-
chmod o-r ~/.bashrc
- A long list of files scrolled by. Many were not in /root.
-
ln -s /root ~/myroot
- Yes, I can read files there, but cannot create or modify files.
Home
Copyright (c) by the authors.
This section of the wiki is licensed under the terms of the GNU Free Documentation License.
See the LBook-licensing page for details.
Linux® is a registered trademark of Linus Torvalds.
Welcome to LinuxBasics.org - The online community that helps people to get Linux installed and running.
During this tour, we will guide you through our website, which has many facets which wait to be explored
The biggest project we are running is our Linux course, based on the LBook.
The book is stored in wiki-format, which enables us to update and correct it as we go.
Discussion for the course is on our Forum
Our Forum is used for discussion of Linux and for questions and answers.
Search the mailing-list that was used prior to the Forum.
The questions and answers from the list are stored in the list's archives in order to help others with the same problems.
Every weekend, we meet to chat in IRC. These meetings are NOT mandatory, but are a nice chance to get to know each other better.
IRC is also a great tool to solve many problems, since it is very quick and easy to ask for more details if you need them.
The tutorials are one of the oldest sections on the LBo-website.
Here you find explanations on how to do specific tasks in Linux. Many of the tutorials were created after a certain problem
has been discussed (and usually solved :) on the mailing-list.
The tutorials are categorized in
In the links section, you find outbound links to other valuable resources.
One of our later additions to the site. We maintain a mirror of the Linux Documentation Project. This is our contribution to the "home of the HOWTOs"
Another later addition is the LBlog which focuses on how to do stuff on the Linux Desktop. It begins with the basics on installing Ubuntu.
Using the integrated site-search, you can search the tutorials, the LBook and all other wiki-pages
Simply type the search term into the box in the upper-right corner of our webpages
As a community, we depend on your feedback and collaboration. So, if you have something to share with others, please contact us. If you have a suggestion for a topic you would like to see covered here, please add it on the Wishlist.
There are many ways to contribute: You can answer questions on the Forum, you can write a complete tutorial or just a step-by-step documentation on how you completed a specific task using linux. Ask questions if the information on this site is not clear, tell us if we got something wrong, spell-check our writings, whatever.
We are looking forward to meeting you at LinuxBasics.org
Anita, Jisao, Sam and Stefan