Urgent help on Linux | |
Anonymous Coward User ID: 13025083 United States 03/10/2013 05:07 PM Report Abusive Post Report Copyright Violation | /home/msabbar/sample_dir2 Quoting: IMAX `-- sample_dir |-- admin |-- cambridge | |-- cafeteria | |-- library | `-- security | |-- annex | |-- building | `-- parking |-- faculty |-- history.exe |-- markham | |-- annex | |-- building1 | `-- parking `-- stenton |-- gen_ed | |-- Holidays | `-- cars2 `-- lib_arts |-- english.txt `-- match.doc 11 directories, 11 files Your current directory is stenton. Copy the first 300 lines of file ~bto120/phones to a new file called phone_directory in stenton. This file contains phone number and location information, sorted by last name, which is the first field in each record. any ideas guys? |
Anonymous Coward User ID: 13025083 United States 03/10/2013 05:09 PM Report Abusive Post Report Copyright Violation | how about you go to puppy linux lucid and fedora 17 to figure it out, so easy a widows user could figure it out way over my head Quoting: Anonymous Coward 13025083 /home/msabbar/sample_dir2 Quoting: IMAX `-- sample_dir |-- admin |-- cambridge | |-- cafeteria | |-- library | `-- security | |-- annex | |-- building | `-- parking |-- faculty |-- history.exe |-- markham | |-- annex | |-- building1 | `-- parking `-- stenton |-- gen_ed | |-- Holidays | `-- cars2 `-- lib_arts |-- english.txt `-- match.doc 11 directories, 11 files Your current directory is stenton. Copy the first 300 lines of file ~bto120/phones to a new file called phone_directory in stenton. This file contains phone number and location information, sorted by last name, which is the first field in each record. any ideas guys? |
Anonymous Coward User ID: 1339701 United States 03/10/2013 05:09 PM Report Abusive Post Report Copyright Violation | so far so good...i can answer the rest of te questions Quoting: IMAX this one was confusing not just me , but for many if i had another question ... ill post one It is confusing because it uses an undocumented form of the command as the "correct" answer. You would've had it correct a long time ago if not for that. |
Anonymous Coward User ID: 13025083 United States 03/10/2013 05:10 PM Report Abusive Post Report Copyright Violation | *windows sorry how about you go to puppy linux lucid and fedora 17 to figure it out, so easy a widows user could figure it out Quoting: Anonymous Coward 13025083 way over my head Quoting: Anonymous Coward 13025083 /home/msabbar/sample_dir2 Quoting: IMAX `-- sample_dir |-- admin |-- cambridge | |-- cafeteria | |-- library | `-- security | |-- annex | |-- building | `-- parking |-- faculty |-- history.exe |-- markham | |-- annex | |-- building1 | `-- parking `-- stenton |-- gen_ed | |-- Holidays | `-- cars2 `-- lib_arts |-- english.txt `-- match.doc 11 directories, 11 files Your current directory is stenton. Copy the first 300 lines of file ~bto120/phones to a new file called phone_directory in stenton. This file contains phone number and location information, sorted by last name, which is the first field in each record. any ideas guys? |
Anonymous Coward User ID: 1339701 United States 03/10/2013 05:15 PM Report Abusive Post Report Copyright Violation | *windows sorry Quoting: Anonymous Coward 13025083 how about you go to puppy linux lucid and fedora 17 to figure it out, so easy a widows user could figure it out Quoting: Anonymous Coward 13025083 way over my head Quoting: Anonymous Coward 13025083 /home/msabbar/sample_dir2 Quoting: IMAX `-- sample_dir |-- admin |-- cambridge | |-- cafeteria | |-- library | `-- security | |-- annex | |-- building | `-- parking |-- faculty |-- history.exe |-- markham | |-- annex | |-- building1 | `-- parking `-- stenton |-- gen_ed | |-- Holidays | `-- cars2 `-- lib_arts |-- english.txt `-- match.doc 11 directories, 11 files Your current directory is stenton. Copy the first 300 lines of file ~bto120/phones to a new file called phone_directory in stenton. This file contains phone number and location information, sorted by last name, which is the first field in each record. any ideas guys? Can you do this on Windows? find all files containing the string XXX and replace that string with YYY and make backup copies of each file and also make a list of files changed. find . -type f -exec grep -l XXX {} \;|tee /tmp/fileschanged|xargs perl -pi.bak -e 's/XXX/YYY/g' |
IMAX
(OP) User ID: 35675988 Canada 03/10/2013 05:36 PM Report Abusive Post Report Copyright Violation | Your current directory is stenton. Display phone_directory one screen at a time, until you find the record for 'Bruce Byce'. Make a note of his 4-digit telephone extension (you'll need it for the next question), then quit the command: i did: cat phone_directory | more | tail -k > Bruce Byce didn't work what command should i use to stop at Bruce Byce ? Imagine if there was no country Stop the Sabre Rattlings and Wars |
Anonymous Coward User ID: 1339701 United States 03/10/2013 05:37 PM Report Abusive Post Report Copyright Violation | okay so now i cant find this one Quoting: IMAX Your current directory is stenton. Display phone_directory one screen at a time, until you find the record for 'Bruce Byce'. Make a note of his 4-digit telephone extension (you'll need it for the next question), then quit the command: i did: cat phone_directory | more | tail -k > Bruce Byce didn't work what command should i use to stop at Bruce Byce ? more phone_directory |
Anonymous Coward User ID: 33568463 Belgium 03/10/2013 05:40 PM Report Abusive Post Report Copyright Violation | okay so now i cant find this one Quoting: IMAX Your current directory is stenton. Display phone_directory one screen at a time, until you find the record for 'Bruce Byce'. Make a note of his 4-digit telephone extension (you'll need it for the next question), then quit the command: "less phone_directory" then use "/" to start searching and type "Bruce Byce" to find the line containing that name; use "q" to quit. |
Anonymous Coward User ID: 1339701 United States 03/10/2013 05:41 PM Report Abusive Post Report Copyright Violation | okay so now i cant find this one Quoting: IMAX Your current directory is stenton. Display phone_directory one screen at a time, until you find the record for 'Bruce Byce'. Make a note of his 4-digit telephone extension (you'll need it for the next question), then quit the command: "less phone_directory" then use "/" to start searching and type "Bruce Byce" to find the line containing that name; use "q" to quit. more or less, depending on OP's assignment software |
Anonymous Coward User ID: 33568463 Belgium 03/10/2013 05:41 PM Report Abusive Post Report Copyright Violation | |
Anonymous Coward User ID: 35769388 Australia 03/10/2013 05:46 PM Report Abusive Post Report Copyright Violation | okay so now i cant find this one Quoting: IMAX Your current directory is stenton. Display phone_directory one screen at a time, until you find the record for 'Bruce Byce'. Make a note of his 4-digit telephone extension (you'll need it for the next question), then quit the command: i did: cat phone_directory | more | tail -k > Bruce Byce didn't work what command should i use to stop at Bruce Byce ? need more cats! cat phone_directory | cat | cat | cat | cat | cat | cat | cat | more |
IMAX
(OP) User ID: 35675988 Canada 03/10/2013 05:50 PM Report Abusive Post Report Copyright Violation | okay so now i cant find this one Quoting: IMAX Your current directory is stenton. Display phone_directory one screen at a time, until you find the record for 'Bruce Byce'. Make a note of his 4-digit telephone extension (you'll need it for the next question), then quit the command: "less phone_directory" then use "/" to start searching and type "Bruce Byce" to find the line containing that name; use "q" to quit. should i use pipe '|' when i want to quit? Last Edited by IMAX on 03/10/2013 05:52 PM Imagine if there was no country Stop the Sabre Rattlings and Wars |
Anonymous Coward User ID: 35096685 United States 03/10/2013 05:54 PM Report Abusive Post Report Copyright Violation | i even did this Quoting: IMAX head -n 300 ~bto120/phones | sort > phone_directory and; head -n 300 ~/bto120/phones | sort > phone_directory and ; head -n 300 ~bto120/phones | sort >> phone_directory and; head -n 300 ~/bto120/phones | sort > phone_directory and ; head -n 300 ~/bto120/phones | sort >> phone_directory and still nothing Try it without the -n. The assignment software might not have all of the correct possibilities. Drop the sort since the assignment software might not like that. Get on a Linux command line and try it if you really want to learn. YESSSSSS You = Genius head -300 ~bto120/phones > phone_directory is the answer No, it is not confusing at all! Go back and tell the place you are taking the course that their software is a steaming pile of horse shit! Tell them, "In the wild or in noted version of Linux or UNIX....to simply run, "head -300" would end up a total fucking failure. Tell the dumb shits that the "-n" (aka 'dash n') command line argument is not optional...it is the general way that "shit" gets done in the real world. If they do not like that answer...tell them (and I do not say this jokingly), "Go fuck yourselves...you are too stupid to be teaching computer courses...you might want to put on-line basket weaving courses instead!" |
Anonymous Coward User ID: 33568463 Belgium 03/10/2013 05:54 PM Report Abusive Post Report Copyright Violation | okay so now i cant find this one Quoting: IMAX Your current directory is stenton. Display phone_directory one screen at a time, until you find the record for 'Bruce Byce'. Make a note of his 4-digit telephone extension (you'll need it for the next question), then quit the command: "less phone_directory" then use "/" to start searching and type "Bruce Byce" to find the line containing that name; use "q" to quit. should i use pipe '|' when i want to quit? i am simply quoting the above, so you can reread it. thoroughly. |
IMAX
(OP) User ID: 35675988 Canada 03/10/2013 05:55 PM Report Abusive Post Report Copyright Violation | cuz i'm doing less phone_directory | grep "Bruce Byce" still tells me to try again...it's weird it tells me to make not of his phone number , 'then' quit the comman..!!! Your current directory is stenton. Display phone_directory one screen at a time, until you find the record for 'Bruce Byce'. Make a note of his 4-digit telephone extension (you'll need it for the next question), then quit the command: i think i'm doing it right... i didn't learn it any other way Last Edited by IMAX on 03/10/2013 05:56 PM Imagine if there was no country Stop the Sabre Rattlings and Wars |
Anonymous Coward User ID: 35769388 Australia 03/10/2013 05:56 PM Report Abusive Post Report Copyright Violation | okay so now i cant find this one Quoting: IMAX Your current directory is stenton. Display phone_directory one screen at a time, until you find the record for 'Bruce Byce'. Make a note of his 4-digit telephone extension (you'll need it for the next question), then quit the command: "less phone_directory" then use "/" to start searching and type "Bruce Byce" to find the line containing that name; use "q" to quit. should i use pipe '|' when i want to quit? no, you should use 'q' like he said. HOW TO SOLVE ALL THESE PROBLEMS: 1. Read the question 2. Understand the question 3. Do a web search, for example "linux display one page at a time". (obviously this changes each question, see previous 2 steps) 4. Find the command that can "display one page at a time" or whatever the current question says. The web search will indicate that "more" or "less" can do this. 5. Read the manual page so that you know how to use those commands: man more; man less 6. Did you skip reading the manual page??? GO BACK AND READ THE MANUAL PAGE!!! 7. Try out the commands to make sure you know how they work 8. Type in the correct command 9. Bask in the happy feelings you got from figuring it out! |
Anonymous Coward User ID: 33568463 Belgium 03/10/2013 05:56 PM Report Abusive Post Report Copyright Violation | No, it is not confusing at all! Go back and tell the place you are taking the course that their software is a steaming pile of horse shit! Tell them, "In the wild or in noted version of Linux or UNIX....to simply run, "head -300" would end up a total fucking failure. Tell the dumb shits that the "-n" (aka 'dash n') command line argument is not optional...it is the general way that "shit" gets done in the real world. If they do not like that answer...tell them (and I do not say this jokingly), "Go fuck yourselves...you are too stupid to be teaching computer courses...you might want to put on-line basket weaving courses instead!" Quoting: Anonymous Coward 35096685 linux does not follow the posix standards. |
Anonymous Coward User ID: 35769388 Australia 03/10/2013 05:56 PM Report Abusive Post Report Copyright Violation | cuz i'm doing Quoting: IMAX less phone_directory | grep "Bruce Byce" still tells me to try again...it's weird it tells me to make not of his phone number , 'then' quit the comman..!!! Your current directory is stenton. Display phone_directory one screen at a time, until you find the record for 'Bruce Byce'. Make a note of his 4-digit telephone extension (you'll need it for the next question), then quit the command: less phone_directory then press "space" until you find Bruce then make a note of his number then press "q" |
Cambrie
User ID: 30869400 United States 03/10/2013 05:58 PM Report Abusive Post Report Copyright Violation | |
IMAX
(OP) User ID: 35675988 Canada 03/10/2013 06:01 PM Report Abusive Post Report Copyright Violation | cuz i'm doing Quoting: IMAX less phone_directory | grep "Bruce Byce" still tells me to try again...it's weird it tells me to make not of his phone number , 'then' quit the comman..!!! Your current directory is stenton. Display phone_directory one screen at a time, until you find the record for 'Bruce Byce'. Make a note of his 4-digit telephone extension (you'll need it for the next question), then quit the command: less phone_directory then press "space" until you find Bruce then make a note of his number then press "q" ^^This Imagine if there was no country Stop the Sabre Rattlings and Wars |
Anonymous Coward User ID: 35769388 Australia 03/10/2013 06:02 PM Report Abusive Post Report Copyright Violation | |
IMAX
(OP) User ID: 35675988 Canada 03/10/2013 06:03 PM Report Abusive Post Report Copyright Violation | ^THIS except quotes only around the search term since it is two words: cat phone_directory | grep "Bruce Byce" needs more cats!!! cat phone_directory | cat | cat | cat | cat | cat | cat | grep "Bruce Byce" hey Aussie dude...you are way smart for this thanks for your help and thank you belgium AC for the help as well Imagine if there was no country Stop the Sabre Rattlings and Wars |
Cambrie
User ID: 30869400 United States 03/10/2013 06:03 PM Report Abusive Post Report Copyright Violation | |
IMAX
(OP) User ID: 35675988 Canada 03/10/2013 06:06 PM Report Abusive Post Report Copyright Violation | if i want move back to a parent directory shouldn't i do .. ? Last Edited by IMAX on 03/10/2013 06:07 PM Imagine if there was no country Stop the Sabre Rattlings and Wars |
Anonymous Coward User ID: 35769388 Australia 03/10/2013 06:07 PM Report Abusive Post Report Copyright Violation | hey Aussie dude...you are way smart for this Quoting: IMAX thanks for your help and thank you belgium AC for the help as well TOP TIP FOR USING Linux and UNIX(TM): READ THE MANUAL!!! You cannot remember every detail of every command on every type of UNIX and Linux system! However, the manual should be supplied with each system. Therefore, read the manual, and you will learn much stuff!!! "man" should be your most used command! man more man less man grep man ls man cat man dog man eating shark all these are valid commands!!! you should try them!!!! |
Anonymous Coward User ID: 35769388 Australia 03/10/2013 06:07 PM Report Abusive Post Report Copyright Violation | |
Cambrie
User ID: 30869400 United States 03/10/2013 06:09 PM Report Abusive Post Report Copyright Violation | |
Fred User ID: 35605840 United States 03/10/2013 06:13 PM Report Abusive Post Report Copyright Violation | |
Anonymous Coward User ID: 33568463 Belgium 03/10/2013 06:14 PM Report Abusive Post Report Copyright Violation | less phone_directory Quoting: Anonymous Coward 35769388 then press "space" until you find Bruce then make a note of his number then press "q" ^^This while using "less", you can use "/" to search for things in a linear fashion. just type "/" followed immediately by your search string, and then hit enter. |
IMAX
(OP) User ID: 35675988 Canada 03/10/2013 06:16 PM Report Abusive Post Report Copyright Violation | NO! .. isn't a command! (hopefully) cd is a command to change directories!!! oh silly me if i want to display all files within a directory (and it's sub dir) that are larger than 10k byts should i use cat sample_dir | -n 10 tail ? Display all the files within sample_dir (and it's subdirectories) that are larger than 10k bytes: Imagine if there was no country Stop the Sabre Rattlings and Wars |