Teknosurf.it
gratis

Novità
Chi Siamo
Il Network
Policy
Privacy
Glossario
Advertising
Pay Per Click
Banner Advertising
E-mail Advertising
SMS Advertising
Affiliate Marketing
Posizionamento
SEO Copywriting
Posta Elettronica Certificata
Registraz. domini
Hosting
Web agency
E-mail anti-spam
E-mail antivirus
Telecomunicazioni
Consulting
199-441225
Info
Rivenditori
Press room
Partnership
Dicono di noi
Lavora con noi
Inserzionisti
Rivenditori
Assistenza
Google
Web teknosurf.it

 
Basic Linux Commands - Q&A

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

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"

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

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.

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

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

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)

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

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

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

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

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

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

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

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

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

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

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}'

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}'

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

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

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

Q. How can I talk to a User on my Linux box?
A. At your Linux prompt who write +d

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

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

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

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

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

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

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

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

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" \;

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

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

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

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

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.

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

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

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

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

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

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

Q. How do I check my email with fetchmail?
A. Create a file called ~/.fetchmailrc containing poll proto pop3 user with pass is 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 
 
Glossario
Info generali hosting
Manuale Plesk
Script teknomail.pl
Basic Linux Commands Q&A
Stampa lettere AR
Regole trasferimento domini
Regole domini.it
Contatti




Copyright © 1997-2023 Teknosurf.it Sas.
All rights reserved. P.IVA 01264890052
Privacy Policy - Contatti