LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   top 50 things to know (https://www.linuxquestions.org/questions/linux-newbie-8/top-50-things-to-know-664677/)

kemet 08-22-2008 03:20 PM

top 50 things to know
 
I am new here and I have been using Ubuntu and Gentoo for a few months now...I was wondering about tips/tricks for Ubuntu or Gentoo that may come in handy - even if its simple technique all is welcomed. I am trying to put together a little help guide for myself so i can get more grounded in these distros, can anyone help me please? Could be from desktop to server configuration anything is helpful. Thanks in advance.

Yuki_Nagato 08-22-2008 03:26 PM

"sudo XXX" will prompt you for a password the first time, a nice warning that makes you think for an extra second. It doesn't do that the second time. Watch out.

For Ubuntu: "sudo apt-get install ubuntu-restricted-extras" will allow you to get around the GNU and play much media and such.

sycamorex 08-22-2008 04:06 PM

If you have installed something and want to know where it has installed or what files have been modified/created or you downloaded something but you don't remember where it downloaded you can try a simple command:

find / -cmin -10

it will find all the files created within the last 10 minutes

find / -mmin -10

it will find all the files modified within the last 10 minutes.

Tinkster 08-22-2008 05:10 PM

Quote:

Originally Posted by sycamorex (Post 3256386)
I've you have installed something and want to know where it has installed or what files have been modified/created or you downloaded something but you don't remember where it downloaded you can try a simple command:

find / -cmin -10

it will find all the files created within the last 10 minutes

find / -mmin -10

it will find all the files modified within the last 10 minutes.


Ummmm ... NO.

Linux has no knowledge of file creation times. The difference
between mmin and cmin (or mtime/ctime, respectively) is that the
c-variants mark the time the files INODE information was last
modified, whereas the m-ones pertain to the files content.

Most of the time you'll find them to be the same.


Cheers,
Tink

sycamorex 08-22-2008 05:19 PM

oops, my apologies

texasone 08-22-2008 05:28 PM

$ rm XXX
will delete a file

$ rm -rf XXX
will delete a folder

make sure that you double check to make sure you have the right file/folder to delete because the remove command will plain old remove, it won't place it in the trash. its best to "cd" to the folder that it is kept in because then you only need the name and you don't need to type a bunch of folders. and never, with out absolutely knowing what it is, deleting something because some one online told you too.

trickykid 08-23-2008 12:07 AM

Sometimes I like to create a backup file when I'm about to edit the original, like say httpd.conf or similar and the path could be rather lengthy, so something like this saves you some typing:

Code:

# ls /etc/httpd/conf.d/httpd.conf
httpd.conf
# cp /etc/httpd/conf.d/httpd.conf{,.bak}
# ls /etc/httpd/conf.d/httpd.conf*
httpd.conf    httpd.conf.bak

You could pretty much do the same thing to compare the files later with diff by doing:

Code:

# diff /etc/httpd/conf.d/httpd.conf{.bak,}

Another thing I like or find handy is something like this to take the previous listings after a command to run against another command:

Code:

# touch file1 file2 file3
# ls !* 
ls file1 file2 file3
file1  file2  file3

Also something else I don't see used as often is this and comes in handy to switch back to a directory with little typing:

Code:

# cd /home/trickykid
# pushd .
/home/trickykid  /home/trickykid
# cd /var/lib/mysql
# popd
/home/trickykid
# pwd
/home/trickykid



All times are GMT -5. The time now is 01:46 AM.