• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 359
  • Last Modified:

many question in linux

hi
iam beginner in linusx and i have many question
1-if i edit file with "vi"in which the word "linux" apper 10 times what command must i type with  i to change the word linux to word  "windows" at the same time
2- if iam in workstation in the directory  /usr/local/bin what command i can use to move myself into the  /usr directory
3- if i want to copy  /usr/bin  dirctory and all contents to director tmp what command i can use
4-what command i can use to copy  usr/bin directory and all contents  to the directory /tmp/copy/testdir (if the directory not exist)
5-if i want to create file /usr/bin/home/test  and the directory /usr/bin/home not exists what command must i use
6-what command must i use to set permission to owner :read only :group ,read and execute,other no access to the file /usr/bin/home/test
7-in which file would i set the system run level
8-what run level has to be selected to start graphics at boot time
9-i which directory can i find the scripts used to start processes / srevices when the system set to run level 3
10- what command i can use to find CPU information in linux workstation
11-what is the full path to the device file for rhe firs scis tape drive
12-what command i can use to start partitions the first scis disk in system
13-if i hve workstation named   home1 with ip address 10.1.1.1 on another workstation home2 i type ping home1 with an ip addree 10.1.1.1 and i get error "unknown host" what file must i edit on home2 to resolve this and what test must i add to this file
14-what commanmd i need to run on "utility1" server to set "opteron1" to automatically rebuild at the nest reboot
15-if i hvae server named "server1" and on its file system named /apps if i logged to workstation as the root user and i want to access the /apps filesystem as mount point /local/bin/apps on my workstation what commands must i type
0
nasemabdullaa
Asked:
nasemabdullaa
2 Solutions
 
omarfaridCommented:
Hi,

To start Linux will never change to Windows :)

1- After you vi the file (e.g. vi myfile) and while you are in vi command mode (press Esc key to be in command mode), run

:1,$ s/linux/windows/g

Please note the exact syntax above (you should see it at the bottom of the screen, and note the colon)

1,$ means from line 1 to the end of file ($ means last line)

s/linux/windows/g     this means substitute linux by windows globally (i.e. if there are multiple occurrences of the work linux in the same line, all will be replaced with windows. If you do not  wont this, then remove /g)

2- use cd ../..  or cd /usr

3- cp -rp /usr/bin /tmp (but be careful /usr/bin is big dir and you may fill up /tmp. Make sure you  have enough space). Some version you need -R in place of -r.

4- two steps

mkdir -p /tmp/copy/testdir

cp -rp /usr/bin /tmp/copy/testdir

5- see step one in 4

6- chmod u=r,g=rx,o=0 /usr/bin/home (if home is a dir and you want to set for all files and subdir under it use -R along with chmod)

7- /etc/inittab (use man inittab or man init to see how)

8- Normally run level 2 or 3, but look at man init to see your system

9- /etc/rc0.d and /etc/rc* . For each run level you will see a subdir under /etc

13- add ips and hostnames to /etc/hosts. The format is

ipadd1     host1
ipadd2     host2

15- use NFS share. You need to set up nfs shares and use mount command to mount remote nfs share




0
 
4dimachCommented:
Hi,
 
No offense, but can I recommend  a Linux book? Something with Bible in title. Fedora or Ubuntu..

Thanks.
0
 
nasemabdullaaAuthor Commented:
hi
thanks for your reply
1-about question 1i mean if i edit file with "vi"in which the word "linux" apper 100 times what command must i type within "vi" to change the word linux to word  "solaris" at the same time
is thia comman true            1,$ s/linux/solaris/g

2-about question 5   if i want to create file /usr/bin/home/test  and the directory /usr/bin/home not exists what command must i use
is this command true                mkdir -p /usr/bin/home/test

3-about queston 6 yes its directory how i can write the command

4- what command i can use to find CPU information in linux workstation
5-what is the full path to the device file for rhe firs scis tape drive
6-what command i can use to start partitions the first scis disk in system

>>>use NFS share. You need to set up nfs shares and use mount command to mount remote nfs share
can you explain more about this


thanks




0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
nasemabdullaaAuthor Commented:
hi 4dimach
thanks for your reply
i do not have book all information i get it from internet (iam beginner in this filed )

thanks
0
 
omarfaridCommented:
Hi,

Regarding vi, it either work in command mode or edit mode.

Edit mode is when you touch any letter key and vi make it part of your file text.

On the other hand, command mode is when vi understand the letter keys as commands.

e.g. in edit mode, if you press j , then j is added to the line you are in. When you are in command mode, then when you press j , then vi understand it as command to move one line down.

To go to command mode, press the Esc key.

Now, back to your questions:

1- the command is correct, but it should be given from a command mode and after (:)

i.e.

 :1,$ s/linux/solaris/g

2- creating file is different from creating dir

to create dir we use mkdir, and if the parent directories are not there, then we use the -p option with the command.

e.g. if you have dir /usr and wants to create a dir like /usr/users/user1//home, then you can use

mkdir -p /usr/users/user1/home

for creating files, you can create files in many ways, e.g. copy a file to a new file.

If your aim is to create an empty file, then you can use touch command:

touch /usr/bin/home/test

but touch will not create sub dir if does not exists

3- use

chmod -R u=r,g=rx,o=  /usr/bin/home (minor correction from previous one)

4- about cpu info, the question is not clear, but you may use

vmstat 5 (this will give statistics about virtual memory and cpu utilization)

top

cat /proc/cpuinfo

procinfo

5- the question is not clear, but device file names are generally under /dev

6- I will refer you to the man page of fdisk

Also, see

http://tldp.org/HOWTO/html_single/Partition/
http://tldp.org/HOWTO/html_single/Partition/#names
http://www.faqs.org/docs/Linux-mini/Partition.html
http://www.linuxmigration.com/quickref/install/disk.html

For NFS on linux, please see

http://nfs.sourceforge.net/nfs-howto/
http://www.linux.org/docs/ldp/howto/NFS-HOWTO/server.html
http://www.linuxhelp.net/guides/nfs/


0
 
DavidTWilsonCommented:
This seems suspiciously like a set of homework questions. ;)
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now