LinuxGuruz
  • Last 5 Forum Topics
    Replies
    Views
    Last post


The Web Only This Site
  • BOOKMARK

  • ADD TO FAVORITES

  • REFERENCES


  • MARC

    Mailing list ARChives
    - Search by -
     Subjects
     Authors
     Bodies





    FOLDOC

    Computing Dictionary




  • Text Link Ads






Linux Tips ' Questions '

  1. Can I execute a command(s) when a certain or any user logs in?
  2. How can I find a file on my system?
  3. How can I find certain words in files on my system?
  4. How do I decompress a .tar, .tar.gz or a .tgz file achive?
  5. How do I create a tar file achive?
  6. How do I set the blank time of my screensaver in console?
  7. How can I find and replace certain words in files?
  8. How do I ignor system messages at login?
  9. Can I make a text version of a man page?
  10. Can I ls just directorys?
  11. How do I read a floppy disk in my A:\ drive?
  12. How do I read my Windows partiton?
  13. How can I tell what filesystems my kernel supports?
  14. I just made changes to my /etc/profile. Do I have to reboot?
  15. I just made changes to my ~/.bash_profile. Do I have to reboot?
  16. How do I understand what those Linux Signal Errors mean?
  17. How do I decompress a .bz2 file archive?
  18. How do I list the number of files in the current directory?
  19. How do I list the number of subdirectories in the current directory?
  20. I cat a binary file and now my tty is unreadable. How do I fix this?
  21. How do I get back to the last directory I was in?
  22. How can I make a quick timer script?
  23. How can I talk to a User on my Linux box?
  24. How can I talk to all the Users at once on my Linux box?
  25. How can I count the lines in a file?
  26. How can I divide a number?
  27. How do I stop a crontab from emailing me?
  28. How can I have the results of a crontab be emailed to a User?
  29. How do I list files by size?
  30. How do remove blank lines from a file?
  31. How do I Add, Edit or Delete a crontab?
  32. How can I get the number of files (inodes) in all the directories in the current directory?
  33. How can I check the processes of two or more users?
  34. I have a command aliased with switches. How do I unalias it quickly?
  35. How do I kill a user and thier processes?
  36. How do a split up a file so that it will fit on floppys?
  37. How do I turn my numberlock key on at bootup?
  38. How can I list loaded modules currently in use?
  39. How do I list the contents of a tar or tar.gz file?
  40. How do prevent pico from wrapping long lines?
  41. How can I find out how much memory I am using?
  42. How can I check how much space I am using on my hard drive(s)?
  43. How can I check how much hard drive space a certain directory is using?
  44. How do I check my email with fetchmail?

Linux Tips ' Answers '

Q. Can I execute a command(s) when a certain or any user logs in?
A. Sure! Basicly add the following to '/etc/profile'. # EXAMPLE: USER_NAME=`whoami` case "$USER_NAME" in "root") command;; "shelly") command;; *) command;; esac # The "*" asterisk assigns the default action. # SYNTAX: case "$VARIABLE" in value1) command ;; value2) command command command ;; value3) command command ;; value4) command ;; *) command command ;; esac

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How can I find a file on my system?
A. Just do this at your prompt. find DirectoryName -name FileName -printf "Found file: %p \n"

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How can I find certain words in files on my system?
A. Just do this at your prompt. find DirectoryName -type f -printf "%p " | xargs egrep -i "String" | less

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How do I decompress a .tar, .tar.gz or a .tgz file achive?
A. Its simpily... tar -xzvf for a .tar.gz or .tgz file. # or... tar -xvf for a .tar file.

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How do I create a tar file achive?
A. Its simpily... tar -cvf FileOrDirectory.tar FileOrDirectory # or to gzip it at the same time... tar -czvf FileOrDirectory.tgz FileOrDirectory

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How do I set the blank time of my screensaver in console?
A. Usally set in /etc/rc.d/rc.M # EXAMPLE: # To make your screen blanks after 15 minutes of idle time. /bin/setterm -blank 15

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How can I find and replace certain words in files?
A. Just do this at your prompt. perl -e "s/old_string/new_string/g;" -pi.save $(find DirectoryName -type f)

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How do I ignor system messages at login?
A. Just do this at your prompt. touch ~/.hushlogin

Return to the Questions
Return to the LinuxGuruz Main Page

Q. Can I make a text version of a man page?
A. Just do this at your prompt. man ManName | col -b > ManName.txt

Return to the Questions
Return to the LinuxGuruz Main Page

Q. Can I ls just directorys?
A. Just do this at your prompt. ls -l | grep "^d"

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How do I read a floppy disk in my A:\ drive?
A. Very simply. mkdir /floppy; mount -t msdos /dev/fd0 /floppy

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How do I read my Windows partiton?
A. At your Linux prompt type this. mkdir /win; mount -t vfat /dev/hda1 /win

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How can I tell what filesystems my kernel supports?
A. Just type this at you Linux command prompt. cat /proc/filesystems

Return to the Questions
Return to the LinuxGuruz Main Page

Q. I just made changes to my /etc/profile. Do I have to reboot?
A. No you don't if you do this at your prompt. source /etc/profile

Return to the Questions
Return to the LinuxGuruz Main Page

Q. I just made changes to my ~/.bash_profile. Do I have to reboot?
A. No you don't if you do this at your prompt. source ~/.bash_profile

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How do I understand what those Linux Signal Errors mean?
A. They are listed in the man pages if you know where to look. Try... man 7 signal

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How do I decompress a .bz2 file archive?
A. Its simpily... bzip2 -dv FileName.bz2

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How do I list the number of files in the current directory?
A. At your Linux prompt type ls -la |grep "^-" |awk 'END {print "Number of files: " NR}'

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How do I list the number of subdirectories in the current directory?
A. At your Linux prompt type ls -la |grep "^d" |awk 'END {print "Number of directories: " NR}'

Return to the Questions
Return to the LinuxGuruz Main Page

Q. I cat a binary file and now my tty is unreadable. How do I fix this?
A. Do this at your Linux prompt <Control>+v <Escape>+c

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How do I get back to the last directory I was in?
A. Just type this at your Linux prompt cd -

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How can I make a quick timer script?
A. Create and run this quick BASH script #!/bin/sh tput clear while tput home; do date sleep 1 done

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How can I talk to a User on my Linux box?
A. At your Linux prompt who write <the user name> <the tty> <message> <message> <Control>+d

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How can I talk to all the Users at once on my Linux box?
A. At your Linux prompt wall <message> <message> <Control>+d

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How can I count the lines in a file?
A. At your Linux Prompt wc -l <file name>

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How can I divide a number?
A. At your Linux Prompt echo "1234567 / 2" | bc

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How do I stop a crontab from emailing me?
A. Just add this to the end of the crontab line > /dev/null 2>&1

For example:

# Run my_script every 5 minutes

*/5 * * * * /usr/local/bin/my_script > /dev/null 2>&1

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How can I have the results of a crontab be emailed to a User?
A. Just use mailx Syntax: [command or script] | mailx -s "Subject line" [EMAIL] For example: # Run date_script every 20 minutes */20 * * * * /bin/date_script | mailx -s "Date script cron" root

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How do I list files by size?
A. At your Linux prompt type ls -l | sort -n +4

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How do remove blank lines from a file?
A. Just use sed sed -e '/^$/d' <file with blank lines > <new file>

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How do I Add, Edit or Delete a crontab?
A. At the command prompt type crontab -e

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How can I get the number of files (inodes) in all the directories in the current directory?
A. Use this find command find . -xdev -type d -exec /bin/echo -n {} \; -exec sh -c "ls {} | wc -l" \;

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How can I check the processes of two or more users?
A. Just use egrep ps -aux | egrep '<user one>|<user two>'

Return to the Questions
Return to the LinuxGuruz Main Page

Q. I have a command aliased with switches. How do I unalias it quickly?
A. Just preceed the command with a backslash '\' For example if you have an alias: alias pico='pico -w -z' Use: \pico

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How do I kill a user and thier processes?
A. This will work nicely su - <user name> -c 'kill -9 -1'

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How do a split up a file so that it will fit on floppys?
A. Use split: split -b 1400000 <file name> To reassemble use cat: cat x* > <original file name>

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How do I turn my numberlock key on at bootup?
A. Use setleds # Example: # Use the setleds program, for example (in /etc/rc.local # or one of the /etc/rc.d/* files): for t in 1 2 3 4 5 6 7 8 do setleds +num < /dev/tty$t > /dev/null done # Alternatively, patch your kernel. You need to arrange # for KBD_DEFLEDS to be defined to (1 << VC_NUMLOCK) # when compiling drivers/char/keyboard.c.

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How can I list loaded modules currently in use?
A. At your Linux prompt type: lsmod

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How do I list the contents of a tar or tar.gz file?
A. You can list the contents of a tar archive with the -t switch. To list the contents of a .tar file type: tar -tf filesname.tar To list the contents of a .tar.gz file type: tar -ztf filesname.tar.gz

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How do prevent pico from wrapping long lines?
A. Start pico with: pico -w

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How can I find out how much memory I am using?
A. At your Linux prompt type: free

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How can I check how much space I am using on my hard drive(s)?
A. At your Linux prompt type: df

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How can I check how much hard drive space a certain directory is using?
A. At your Linux prompt type: du -s <directory name>

Return to the Questions
Return to the LinuxGuruz Main Page

Q. How do I check my email with fetchmail?
A. Create a file called ~/.fetchmailrc containing poll <mail server> proto pop3 user <user name> with pass <passwd> is <local user name> here
# Then set the correct permissions

chmod 600 ~/.fetchmailrc

# Then to fetch your email type

fetchmail

# Or to automaticly chech your email every so many seconds

fetchmail -d <number of seconds>

Return to the Questions
Return to the LinuxGuruz Main Page


  • MORE RESOURCE


  • Linux

    The Distributions





    Linux

    The Software





    Linux

    The News



  • MARKETING






  • Toll Free

webmaster@linuxguruz.com
Copyright © 1999 - 2016 by LinuxGuruz