/srv/irclogs.ubuntu.com/2014/11/23/#ubuntu-qc.txt

nedal_Bonjour19:42
Ankmanhi19:48
nedal_Je voulais savoir l utilité de la commande cat 19:56
nedal_si on tappe cat 'fichier' ça affiche le contenu de fichier sur le terminal 19:57
nedal_si on tappe cat 'fichier1'  fichier2 ' on liste le contenu des 2 fichiers 19:58
nedal_mais si on ajoute un > entre les 2 fichier 19:58
nedal_ça fait copier le contenu du 1er et le colle dans le 2eme on supprimant le contenu original 19:59
Ankmancat file1 file2 > file320:07
Ankmanumm...20:07
Ankmancat file1 file2 >> file320:07
nedal_ça fait quoi cette commande ? 20:08
nedal_c est quoi la diff entre les 2 ? 20:08
Ankman> fait effacer avant copier20:11
Ankman>> ajute20:11
nedal_Je veux savoir aussi, est ce que le Shell et le terminal sont la même chose ? 20:12
Ankmanajoute (my french is bad, sorry)20:12
Ankmanshell est un logiciel dans un terminal20:13
Ankmanthe shell, like bash, sh and others runs insode a terminal20:14
Ankmaninside20:14
nedal_so shell is what connects the user ( specifically programs) to the kernel 20:15
nedal_and the terminal is where we can do this 20:16
nedal_is that correct ? 20:16
Ankmansheel is an interpreter of commands20:16
Ankmanan environment. like the progamming language Basic20:17
Ankmanfrom the bash man page: "Bash  is an sh-compatible command language interpreter that executes commands read from the standard input or from a file."20:17
nedal_and the terminal  does the same thing, no? 20:18
Ankmanbash is mostly used as default shell in linux. you can find out what you run typing "echo $SHELL" (no "")20:18
Ankmanthe terminal provides the environment of things, like a shell. draws characters and other things20:19
Ankmanyou can eun shell command without a terminal20:19
Ankmanrun20:19
Ankmanhere from my gnome-terminal (that's just one of hundred terminals) man page: "GNOME Terminal is a terminal emulation application that you can use to perform the following actions:20:21
AnkmanAccess a UNIX shell in the GNOME environment.20:21
AnkmanA  shell  is a program that interprets and executes the commands that you type at a command line prompt. When you start GNOME Terminal, the application starts the default shell that is specified in your system account. You can switch to a different shell at any time.20:21
AnkmanRun any application that is designed to run on VT102, VT220, and xterm terminals.[6~20:21
Ankmana terminal is like a television: it shows things inside (text output usually)20:23
nedal_it s pretty much clear now, thank you Ankman 20:24
Ankman:-)20:27
nedal_please, how can I switch to a different shell 20:28
nedal_and, is it dangerous ? 20:28
nedal_because I m a new Linuxien 20:28
nedal_I used to work on windows20:29
Ankmanyou just type the name of the other shell. that opens the new shell in the old shell. like a cascade20:29
Ankmanbut the bash shell is the most powerfull. i wouldn't change it20:30
Ankmanwindows also has a quite powerfull shell. called cmd20:31
Ankmanif you want to see what bash can, type "man bash". you can scroll up and down with the curser keys. "q" brings you back to the command prompt20:31
nedal_ah okey !! then the equivalent of cmd is bash !20:32
Ankmanyou can do "man" with almost anything on linux. man stands for manual. those are the so called man pages20:32
nedal_yes I know :)20:33
Ankmanyes, cmd and bash are shells. but different although some command work the same way20:33
Ankmani don't know if cmd has "pipes". bash and sh have20:33
nedal_pipes ? what s that ? 20:34
Ankmanit's a | where what is output on the left is used as input for what is on the right. i try to think of an example...20:35
Ankmando you know "grep"?20:35
nedal_yes I know grep20:37
Ankmanmeans "get regular expression pattern" and is a powerfull filter itself. easiest example is "grep nedal_ /etc/passwd" which should list only your user in that file20:37
Ankmanokay20:37
Ankmananother is called "ps" which lists all running processes. now the example...20:37
Ankmanps axu | grep 10020:37
Ankmanthat would list all processes, "pipes" them to grep and grep filters for "100". so only if something has "100" there will be listed20:38
nedal_ok I see 20:39
Ankmanyou can have a lot of pipes. one take the output of the previous20:39
Ankmanlike20:40
nedal_it s like the {} on find command 20:40
Ankmanps axu | grep 100 | grep root20:40
nedal_??20:40
nedal_kind of20:40
Ankmani think {} runs the command in there20:42
Ankmanin bash the $() does it20:43
Ankmanor what is inside ``20:43
nedal_I cant understand very well but i guess it s normal20:52
nedal_i m a new user of linux 20:52
Ankmanit's called "Command Substitution" and most linux user never go so deep into the shell ;-) i try to find an example20:56
nedal_before that, do you know the difference between more and less? because I see that both print the contents of the file20:58
Ankmanlet's say you have a file called "nedal" which has "ps axu | grep 100" as content20:59
Ankmanthen $"(cat nedal)" will do the same as "ps axu | grep 100"20:59
Ankmanmore is not so user friendly. you cannot scroll up for example21:00
Ankmananyway, most linux users never so so deep into it. it very complex and big. but if you want you should get a book or online tutorial21:01
nedal_i can scroll up with 'b'21:03
nedal_and scroll down with space21:03
Ankmanin more? oh that i didn't knew21:04
Ankmanha! :-)21:04
nedal_:D happy to bring you something new !21:06
Ankman:-)21:07

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!