Linux questions


 
Thread Tools Search this Thread
Operating Systems Linux Linux questions
# 1  
Old 09-09-2003
Linux questions

Hi everyone,

I came from a diffrent UNIX background and am trying to learn Linux (Red Hat) in a hurry. I would be very grateful if you could help me with the following questions. I know the answers for questions 1, 3, and 4 in a Sun Solaris environment, but not in Linux... Thanks in advance for your help!

1. When the command "touch" is used to create a file, it assigns some default permissions to the file. What would you do to make "touch" command create files with different default permissions?


2. Using bash shell, run the following commands in a clean directory:

for ((i=20000;i--;)) ; do touch test$i ; done
for ((i=10;i--;)) ; do touch file$i ; done

This will take a while.

Now try to list all files beginning with 'test':

ls test*

This will give an error:

bash: /bin/ls: Argument list too long

How would you get around this problem (i.e., successfully list all these files)?


3. How would you automatically mount a device each time the system starts up?


4. While trying to "umount" a device, it will fail if the device is busy. How would you determine which process is causing the device to be busy?


-- Enigma777
# 2  
Old 09-10-2003
1. I think you have to set a different umask in the shell startup file, e.g. .bashrc

umask 0022

See bash(1) manpage

3. Edit the corresponding entry in /etc/fstab and change from noauto to auto
# 3  
Old 09-11-2003
The solutions listed below will work on Linux as well as other UNIX systems. Here is the summary (based on my research and your replies):

1. You can use the "umask" command to make the "touch" command create files with different default permissions.

2. To avoid the limitation of the "ls" command, you can use the following command to list large number of files:

find . -name "test*"

3. You can use the /etc/fstab file to automatically mount a device each time the system starts up.

4. To determine which process is causing the device to be busy, you can use the "fuser" command like this (just an example):

fuser -v /mnt/cdrom


Thanks for your replies!


--Enigma777
# 4  
Old 09-11-2003
For (2), you may also try

ls | xargs -i echo {}
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Linux Internals Interview Questions

Can anyone list the interview questions on Linux Internals? Any link for the same will also be helpful. In a job requirement of say C, linux internals what is expected about linux internals? (0 Replies)
Discussion started by: rupeshkp728
0 Replies

2. UNIX for Dummies Questions & Answers

Unix and Linux questions

Sorry for the dumb question......I got my B.S. in computer science Amazing how I don't these answers).....I wrote mostly in the language C in my college career. I wrote all my programs using a windows application for writing C.....and then after testing it, I would upload it to a UNIX system and... (1 Reply)
Discussion started by: Bruuuuce78
1 Replies

3. UNIX for Dummies Questions & Answers

Few questions on unix/linux

Hi , please give few answers for this questions:confused::confused: ...thanks in advance What shell do you use when you log in to a UNIX/Linux host? What command will show you the shell you're using? Describe 5 things you can do in Linux/UNIX. (1 Reply)
Discussion started by: hecker007
1 Replies

4. Linux

Few Questions on about Linux Servers.

1.On x86 Machines ( Pentium4 ), What is the maximum number of Services( sshd, ntpd,named ,samba, etc.) that can be installed.? Is there a rule of thumb to attain the best possible performence.? 2. Is there a systematic way to boot a remote Machine.? 3. Are there any problems of having two... (2 Replies)
Discussion started by: kanata
2 Replies

5. Red Hat

Lots of questions about linux.

I am about 2 months new to Linux, and have only limited experience with PCLinuxOS, (kde) and Redhat. I am installing the latest version of PClinuxOS on my wife's PC right now but running into a problem I dont understand. I have never seen it before so i thought i'd ask how I can get around it.... (1 Reply)
Discussion started by: Methal
1 Replies

6. What is on Your Mind?

Questions about Unix/Linux

Hello all. Im a young lad with very limited experience with computers, even though I have been playing with them the past 5 years. I have the experience of the random World of Warcraft player that plays games all day. I have a huge interest in learning everything about computers and I was... (5 Replies)
Discussion started by: Vallzi
5 Replies

7. UNIX for Dummies Questions & Answers

General Linux Questions

Hello :-) I am new to the world of UNIX/LINUX and I have just purchased my first Web Server. I have "root" access to the system and I have a few basic questions, they are: 1. How do you view all user names that have access to the system? 2. How do you add/delete or modify users? Anyone... (1 Reply)
Discussion started by: randy.moretz
1 Replies

8. Linux

some questions about linux system.

Hi,i am a newbie in linux,l have some questions when i study unix system.Could you help me?thx. Q1:an linux file system is broken,it can not be mounted after system boot up .how to recover it? Q2:When the UNIX system shore memory is not enough,how to change the system paramenters? Q3:How... (2 Replies)
Discussion started by: saneryee
2 Replies

9. UNIX for Dummies Questions & Answers

Is there a place like this for LINUX questions?

Is there some place like this unix.com for linux questions? a forum like area to ask questions? I love this site, i've learned a lot (use unix - solaris, and linux - redhat). Unfortunately redhat.com has gotten rid of their support forums, everything is in a list type format and I don't want to... (6 Replies)
Discussion started by: kymberm
6 Replies

10. UNIX for Dummies Questions & Answers

RedHat linux questions??

1. is redhat linux 7.3 the latest version ?? 2. where can i find FREE documentation regarding it ?? installation , etc... Thanks (2 Replies)
Discussion started by: BAM
2 Replies
Login or Register to Ask a Question