Penguin
Annotated edit history of NewUserTips version 17, including all changes. View license author blame.
Rev Author # Line
17 IanMcDonald 1 * The [Linux] equivalent of MicrosoftWindows' <tt>ipconfig</tt> command is [ifconfig(8)].
16 DavidMurrell 2 * The (8) in the above line refers to the manual page for ifconfig in manual section 8, accessible by typing <tt>man 8 ifconfig</tt>
3 ** Other man pages can be accessed by typing <tt>man command</tt> (See <tt>man man</tt> for the man manual)
4 ** Man pages are searchable, type <tt>man -k keyword</tt> to search the man pages containing that keyword. Think of it as a pre google, google search.
7 AristotlePagaltzis 5
10 DanielLawson 6 * Global system configuration files are in the <tt>/etc</tt> directory.
7 AristotlePagaltzis 7
15 IanMcDonald 8 * Under [Debian]-based distributions (such as Debian Sarge, [Ubuntu], etc):
17 IanMcDonald 9 ** Install [Deb] Packages using <tt>dpkg -i filename</tt>. See [dpkg(8)].
12 IanMcDonald 10 ** To search for packages available on your distribution, use <tt>aptitude search name</tt>
11 ** To install a package, and any other packages it depends on, use <tt>aptitude install name</tt>
10 DanielLawson 12 ** Note that names are case insensitive, and contain no spaces. Try doing a substring search if you can't find it at first. Debian has over 15000 packages, so there is a good chance it already has what you want.
7 AristotlePagaltzis 13
10 DanielLawson 14 * Under RedHat-based distributions:
17 IanMcDonald 15 ** Install [RPM] [Package]s using <tt>rpm -Uvh filename</tt>. See [rpm(8)].
10 DanielLawson 16 ** RedHat based systems now offer better PackageManagementTools such as AptForRpm or [Yum]. Use them instead of manually finding .rpms and installing them
7 AristotlePagaltzis 17
17 IanMcDonald 18 * Use <tt>tar xzvf filename</tt> to decompress a <tt>.tar.gz</tt> or <tt>.tgz</tt> file, otherwise known as a TarBall. See [tar(1)]
19 * Use <tt>tar xjvf filename</tt> to decompress a <tt>.tar.bz2</tt> also known as a TarBall. See [tar(1)]
7 AristotlePagaltzis 20
17 IanMcDonald 21 * Don't get involved in [emacs(1)] vs. [vi(1)] arguments. Use [nano(1)], [pico(1)], [joe(1)], or [jed(1)] for your initial editing needs. Once you have gotten a little more comfortable with the system, however, be sure to revisit [emacs(1)] and [vi(1)] as they offer ''tons'' of power you will never get with the simple minded editors. For the latter, [Vim] is the suggested clone, which comes with a <tt>vimtutor</tt> program that should get your over the initial hurdles quickly. ''Does any equivalent for [emacs(1)] exist?''
7 AristotlePagaltzis 22
23 * Before you ask for help online, be sure to read the documentation first. It is sometimes difficult to understand so don't feel bad if you don't get it, just make the attempt. It will either make any explanation you get from someone else clearer, or the explanation will help you understand the documentation. Next time you look at it, the documentation will be less puzzling. If you repeat this a couple times, then you'll soon be cruising along with the docs just fine.
24
25 * If your desktop locks up, Ctrl-Alt-Backspace will kill the graphical environment (the [XServer], in technical terms) and drop you to the [Shell] (or your display manager) without having to reboot the system.
26
27 * You don't have to worry about defragmenting your disks.
28
29 * You don't have to worry about defragmenting your memory.
30
31 * You don't have to worry about mail [Worm]s.
32
33 * [Linux] will crash on you at some point. It happens, no matter what anybody says. However, it won't happen nearly as much as it does on MicrosoftWindows.
34
35 * You don't have to shut down or restart every day. It's ok to leave a [Linux] system running for a week or more (some users have their system running for months at a time). You should still conserve electricity, tho.
36
37 * There is no way to undelete a file in [Linux]. You deleted it, it's gone. See rm(1)
38
17 IanMcDonald 39 * [sudo(1)] will let you execute a command with SuperUser (or any other) privileges; it may need to be configured, in that case, see SudoHowto. If you really need a root shell, you can use [su(1)]: execute <tt>su -</tt> and type the root password. You should never log in as root (except if you managed to get the system so shot up that you can't log in as a user).
7 AristotlePagaltzis 40
41 * Installing a program from source is easier than you think. The sequence is usually along the lines of:
8 AristotlePagaltzis 42 <pre>
43 tar xvzf ''filename''-''version''.tar.gz
44 cd ''filename''-''version''
45 ./configure && make
46 sudo make install
47 </pre>
7 AristotlePagaltzis 48 Note you have to be root for the <tt>make install</tt> step if you are installing into system wide directories. You can always install to your home directory, of course -- which you need to indicate by saying <tt>./configure --prefix=$HOME</tt> on the relevant step. You can also pass many more options, to <tt>configure</tt>, most of which needn't concern you, except for the (usually few) <tt>--enable-''foo''</tt>/<tt>--disable-''foo''</tt> and <tt>--with-''bar''</tt>/<tt>--without-''bar''</tt> which let you hand-pick features to include or omit from the resultant build of the software.
49
50 * Make sure you are working on the correct drive when doing any FileSystem level work -- nuking the wrong partition or disk is annoying to say the least.
51
17 IanMcDonald 52 * Learn how to use redirection ("<tt><</tt>", "<tt>></tt>") and pipes ("<tt>|</tt>") in the [Shell]. See [bash(1)]
10 DanielLawson 53
54 * Your initial WindowManager settings are (generally) stored in the <tt>.xinitrc</tt> or <tt>.xsession</tt> file in your home.
55 ** Note that this isn't so relevant any more with GNOME and KDE
14 IanMcDonald 56
57 !!Handy Ubuntu Tips
58
59 !Write a bash script.
60 Open up your favourite text editor and add this line to the top:
61 *~#~!/bin/bash
62 Now add your bash commands and at end of each line add a ";"
63 Save you file and make sure you chmod to give execute permissions.
64
65 !Extract zips that are in multiple parts.
66 *unzip -d destdir/ \~*.zip
67
68 REMEMBER : The '\' is the escape character. Without it, our command would look like:
69 unzip -d destdir/ 1.zip, 2.zip, 3.zip which is bad because after the first zip argument, the following stuff is read as list arguments. With \~*.zip bash doesn't interpret the ~* but unzip does.
70
71 !Extract rars that are in multiple parts (Using Rar Linux) (eg: .rar,.ro1,r02...)
72 *unrar name.rar destdir/
73 Note: We only need to supply the file with the ".rar" extension. Rar is smart and detects the other files.
74
75 !Cool tools to play around with
76 *cal
77 Typing this command will display a calendar with the date highlighted.
78 *date
79 Will display the date and time in terminal.
80 *dmesg
81 Displays log of messages printed to the screen during the boot process
82
15 IanMcDonald 83 !Where on Earth are the rename and copy commands?
84 * We use the "mv" command when renaming instead.
85 e.g <tt>mv dog cat</tt>
14 IanMcDonald 86 This will rename the file "dog" to "cat".
15 IanMcDonald 87 * The cp(1) command copies files. The <tt>-a</tt> switch is for copying directories.
14 IanMcDonald 88
89 !You can copy/move/list multiple things at a time! Just separate files/expressions with a space.
90 *ls -l *.txt *.letter
91 *cp *.jpg *.bmp ~~/pics/
92
93 !How to Stop listing dir contents when using glob expressions with ls.
94 Use the -d switch to list just the directories, and not the contents of each matching directory.
95
96 !Change Password
97 Simply type "passwd". You will be prompted for the current password and then asked to type in a new password.
98
99 !Jump quickly between words in terminal
100 *Alt-f - Move forward one word.
101 *Alt-b - Move backward one word.
102
103 !Print to screen first/last few lines of a file.
104 *head -n 20 test.txt
105 Will print to the screen the first 20 lines in test.txt
106 *tail -n 5 test.txt
107 Will print to the screen the last 5 lines in test.txt
108
109 !Print a Message To The Terminal
110 *echo Damn you rock Staz
111 Note : Make sure to type the above exactly as it is written.
112 *echo $PATH
113 Slightly more useful!
114
115 !Display a long file to screen
116 *more test.txt
117 Will print the first page of test.txt to the screen, and you can use arrow keys to navigate further.
118 *less test.txt
119 A more advanced version of more. (Can do Searches etc).
120
121 !Search command History
122 *Alt-r
123 Now Start typing part of the command any matches will be displayed as you type and press enter to use them.
124
125 !What type of file is that??
126 *file <filename>
127 Will return the file type.
128
129 !Reload fstab file
130 *sudo mount -a
131 This mounts everything in your fstab file.
132
133 !How much disk space is the contents of this directory using?
134
135 1)All Folders/Subfolders
136 *du -h
137 2)The current directory
138 *du -sh
139 3)All folders excluding subfolders.
140 *du --max-depth=1 -h
141 4)All folders beginning with the letter P
142 *du -sh P*
143
144 !Mount Samba Shares
145 We need to get the smbfs and smbclient packages.
146 * sudo aptitude install smbfs
147 * sudo aptitude install smbclient
148
149 First lets get a list of the available shares on a particular machine.
150 *smbclient -L <IP/HOST>
151
152 Now create a folder in /media/ that will be the mount point for your samba share.
153 There are two ways of mounting:
154 1.
155 *sudo smbmount //<IP/Hostname>/smbshare /media/mounthere/ -o username=YYYY,password=YYYY,dmask=XXX,fmask=XXX
156 2.
157 *sudo mount -t smbfs //<IP/Hostname>/smbshare /media/mounthere/ -o username=YYYY,password=YYYY,dmask=XXX,fmask=XXX
158
159 dmask = directory umask
160 fmask = file umask
161
162 Now to unmount:
163 *sudo umount/smbumount /media/diryoumountedto/
164
165 !Add a smb share to fstab that is automatically mounted on boot
166 *sudo /etc/fstab
167 Add this line:
168 //HOST/share/ /mount/point/ smbfs auto,username=xxxxx,password=xxxxx,uid=xxxx
169 This website is really good:
170 http://doc.gwos.org/index.php/HowToMountsmbfsSharesPermanently
171
172 !Mount all smb shares listed in fstab
173 *sudo mount -at smbfs
174
175 !Unmount all smb shares listed in fstab
176 *sudo mount -at smbfs
177
178 !List NTFS Mounted Drives
179 * sudo mount -t ntfs
180 If you want to view mounted fat32 drives simply replace "ntfs" with "vfat"
181
182 !How much memory is free?
183 * free -m
184 Will tell you how much free memory is available in megabytes.
185 *free -s 60
186 Will tell you how much free memory is available every 10 seconds.
187
188 !List all your drives
189 * sudo fdisk -l
190 NOTE : Don't forget the "sudo" or else you may not see anything listed.
191 Blocks can be read to mean "Kilobytes"
192
193 !List Drives/Capacity/Free Space
194 *df -B M
195 The -B switch refers to Block Size. The M means it will be displayed in Megabytes.
196 But if you prefer use K for kilobytes, G for gigabytes etc..
197
17 IanMcDonald 198 [df(1)] doesn't require root privileges to work. Also "df -h" will select the right units for you. Many programs that support outputting units will support "-h" for "human readable". The other useful command here is [du(1)].
14 IanMcDonald 199
200 !Install an app from .rpm
201 First you need Alien:
202 sudo aptitude install al
7 AristotlePagaltzis 203
204 See also AdvancedUserTips
205
206 ----
207 CategoryBeginners

PHP Warning

lib/blame.php:177: Warning: Invalid argument supplied for foreach()