Linux commands

(Last Updated On: 02/22/2017)

These are commands I find useful..

get a list of all installed updates

rpm -qa --qf '%{INSTALLTIME} %-40{NAME} %{INSTALLTIME:date}\n' | sort -n

get all CVE’s from all packages

for pkg in `rpm -qa` ; do rpm -q --changelog ${pkg} | grep -i cve ; done

find certain files and move them to a directory

find /which/folder -iname "*.txt" -exec mv {} /path/to/folder \;

find certain files and get the size

find . -iname "*.iso" -exec du -hs {} \;

find files that are less then x days old and print the size

find . -name "*.log" -mtime -5 -exec du -hs {} \;|sort -n

burn a iso to a cd/dvd

wodim dev=/dev/scd0 -v -tao filename.iso

extract a single file from a tar archive

tar --extract --file=/locate/your/file.tar specify_filename.extension

change default editor for launching crontab

env EDITOR=vi crontab -e

check when a filesystem was created. useful to check when the system was built

tune2fs -l /dev/sda1 | grep created

register a server on redhat’s rhn

rhnreg_ks --profilename "servername" --username "username" --password "password"

killing a process with the same name

kill -9 `ps -ef |grep OpC | grep -v grep | awk '{print $2}'`

check what bit level red hat is at

getconf LONG_BIT

get the serial number from APC pdu’s

snmpwalk -v1 -c private pb01.local.domain iso.3.6.1.2.1.1.1.0 | cut -d ":" -f10|cut -d " " -f2

grep multiple strings and sort on column

grep -E '(^mic)|(livelink)' * | sort -n -k4

delete files older than 3 days

find . -type f -mtime +3 -exec rm {} \;

downgrade a package in RedHat

rpm -Uvh --oldpackage --nodeps rpm-4.4.2.3-32.el5_9.i386.rpm

run the du command in the current directory and sort on the second field specifying folder depth

du -h --max-depth=1 |sort -k2

check how long a process has been running for

ps -p PID -o etime=

read inside of a gz file

gzip -cd vmkernel.2.gz | less

list latest installed updates

rpm -qa --qf '%{INSTALLTIME} %-40{NAME} %{INSTALLTIME:date}\n' | sort -n | cut -d' ' -f2-

or

rpm -qa --last

find and replace string in multiple files

grep -rl matchstring somedir/ | xargs sed -i 's/string1/string2/g'

copy files but ignore existing to a remote server

rsync *.jpg -v -e ssh --ignore-existing <username>AThost.com:~/photos/

rename all files to lowercase characters

for f in *; do mv "$f" "`echo $f | tr "[:upper:]" "[:lower:]"`"; done

Users using more then 1% memory

ps aux | awk '$1 != "USER" {t[$1]+=$4} END {for (i in t) {print t[i]" "i}}' | sort –n | grep -v ^0

Apps using more than 1% memory

ps aux | awk '$1 != "USER" {t[$11]+=$4} END {for (i in t) {print t[i]" "i}}' | sort –n | grep -v ^0

export postgres database

/usr/local/PostgreSQL/9.0/bin/pg_dump -U postgres dsvdbase -N topology -T spatial_ref_sys > dbexport.pgsql

60 thoughts on “Linux commands

  1. asmr https://0mniartist.tumblr.com

    We absolutely love your blog and find nearly all of your post’s to be exactly I’m looking for.
    can you offer guest writers to write content for you personally?
    I wouldn’t mind publishing a post or elaborating on some of the subjects you write about here.

    Again, awesome web site! asmr 0mniartist

  2. asmr https://0mniartist.tumblr.com

    Hi there, i read your blog from time to time and i own a similar one and i was just curious if you get a lot of spam
    comments? If so how do you reduce it, any plugin or anything you can recommend?
    I get so much lately it’s driving me crazy so any support is very much appreciated.

    0mniartist asmr

  3. 0mniartist

    of course like your web-site however you need to take a look
    at the spelling on quite a few of your posts. Several of
    them are rife with spelling problems and I in finding it very troublesome
    to tell the reality nevertheless I’ll surely come again again. 0mniartist asmr

  4. Jewell

    Currently it appears like BlogEngine is the preferred blogging platform out
    there right now. (from what I’ve read) Is that
    what you are using on your blog?

  5. 918Kaya test id

    Thanks a bunch for sharing this with all folks you really recognize what you’re talking approximately!

    Bookmarked. Kindly also discuss with my site =).
    We can have a hyperlink change agreement among us

    Also visit my page 918Kaya test id

  6. playboy2 ios

    Very good information. Lucky me I recently
    found your website by chance (stumbleupon). I
    have saved as a favorite for later!

    Also visit my homepage … playboy2 ios

  7. Lpe88Apk Ios

    It’s very trouble-free to find out any matter on net as compared to
    textbooks, as I found this piece of writing at this site.

    My website :: Lpe88Apk Ios

  8. j.mp

    This is my first time pay a visit at here and i am in fact
    pleassant to read all at one place. 0mniartist asmr

  9. Purry888

    An interesting discussion is definitely worth comment.

    I do think that you need to write more about this issue, it might not
    be a taboo subject but usually people do not discuss these subjects.
    To the next! Many thanks!!

    My web-site: Purry888

  10. http://j.mp/

    Just desire to say your article is as amazing. The clearness in your publish is simply cool
    and i can think you’re knowledgeable on this subject. Well together with your
    permission let me to seize your RSS feed to keep
    up to date with forthcoming post. Thanks one million and please carry on the
    enjoyable work. asmr 0mniartist

  11. read more

    A comparable bias occurs in bookmakers’ odds on horse races, soccer, and just about every other sporting event.

  12. Alexandria

    Hey there! This is my first visit to your blog!
    We are a collection of volunteers and starting a new project in a community in the same niche.
    Your blog provided us beneficial information to work on. You have done a wonderful job!

  13. live22 ios download

    When I initially commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I get four e-mails with the same comment.
    Is there any way you can remove me from that service?
    Appreciate it!

    Here is my page: live22 ios download

  14. mega888 for ios

    I must thank you for the efforts you’ve put in writing this blog.

    I really hope to check out the same high-grade content by you later
    on as well. In fact, your creative writing abilities has
    inspired me to get my very own blog now ;)

    Also visit my site … mega888 for ios

  15. Lionking888 Slot

    Its like you read my mind! You seem to know a lot about this, like you wrote the book in it or something.
    I think that you could do with a few pics to drive the message home a little bit, but instead of that,
    this is great blog. An excellent read. I’ll definitely be back.

    my web site Lionking888 Slot

  16. 918kiss plusapk ios

    Hello there, I discovered your website by means of Google while searching
    for a comparable matter, your web site got here up, it seems great.
    I have bookmarked it in my google bookmarks.
    Hello there, simply turned into aware of your blog via Google, and
    located that it’s truly informative. I’m gonna be careful for brussels.
    I’ll appreciate if you happen to continue this in future.
    Lots of folks can be benefited from your writing.

    Cheers!

    Visit my homepage: 918kiss plusapk ios

  17. ntc33apk ios

    Definitely believe that which you stated. Your favorite reason seemed
    to be on the internet the easiest thing to be aware of.
    I say to you, I certainly get annoyed while people think about worries that they
    just do not know about. You managed to hit the nail upon the top and defined out the
    whole thing without having side effect , people can take a
    signal. Will likely be back to get more.
    Thanks

    Also visit my page: ntc33apk ios

  18. click here

    This tactic is prevalent amongst seasoned bettors as the risk of going bust is considerably lowered.

  19. https://918kiss-m.com/

    I have been exploring for a little bit for any high-quality articles or blog posts in this kind of space .
    Exploring in Yahoo I at last stumbled upon this site. Studying this information So i am glad to exhibit that I’ve a very excellent uncanny
    feeling I discovered just what I needed. I most no doubt will make sure to don?t fail to remember this site and provides it a look on a relentless basis.

    Review my site – id king855 (https://918kiss-m.com/)

  20. id test rollex11

    It’s in fact very difficult in this active life to listen news
    on TV, therefore I only use internet for that
    reason, and obtain the most recent news.

    My blog post; id test rollex11

  21. aaa1188 slot game list

    Hi there! I could have sworn I’ve been to this blog before but after
    going through many of the articles I realized it’s new to me.
    Regardless, I’m certainly delighted I found it and I’ll be
    bookmarking it and checking back frequently!

    Feel free to visit my web blog aaa1188 slot game list

  22. judi slot terbaru

    If you desire to grow your know-how simply keep visiting this website
    and be updated with the most recent gossip posted here.

  23. situs judi online

    Hi there are using WordPress for your site platform?
    I’m new to the blog world but I’m trying to get started and set up my own. Do you need any coding knowledge to
    make your own blog? Any help would be really appreciated!

  24. gamefly is

    My brother suggested I might like this blog. He was totally right.
    This post actually made my day. You cann’t imagine just how much time I had spent for this information! Thanks!

  25. asmr off

    Howdy! This is my 1st comment here so I just wanted to give a quick shout out and
    tell you I truly enjoy reading your posts. Can you recommend any other
    blogs/websites/forums that go over the same topics? Thanks a ton!

  26. asmr their

    This paragraph is really a fastidious one it assists new the web people,
    who are wishing for blogging.

  27. asmr are

    I am truly glad to glance at this website posts which carries plenty of helpful data, thanks
    for providing these kinds of data.

  28. Agen Judi Poker

    Hi mates, pleasant paragraph and pleasant arguments commented here, I am genuinely enjoying
    by these.

  29. with gamefly

    Hmm is anyone else encountering problems with the images on this blog loading?

    I’m trying to determine if its a problem on my end or if it’s the blog.
    Any feedback would be greatly appreciated.

  30. asmr that

    What’s up everyone, it’s my first pay a quick visit at this
    web page, and piece of writing is truly fruitful for me, keep up posting these articles or reviews.

  31. http://tinyurl.com/

    Thank you a bunch for sharing this with all people
    you really recognize what you are talking approximately!

    Bookmarked. Kindly also talk over with my web site =).
    We will have a link alternate agreement among us

  32. Elke

    I always used to study paragraph in news papers but now as
    I am a user of internet thus from now I am using net for articles, thanks to web.

  33. asmr it

    Hey There. I found your blog using msn. This is
    a very well written article. I’ll make sure to bookmark it and return to read more of your
    useful information. Thanks for the post. I’ll
    definitely comeback.

  34. a asmr

    What’s up it’s me, I am also visiting this website on a regular basis, this web
    page is genuinely fastidious and the people are in fact sharing nice thoughts.

  35. crokes.com

    scoliosis
    Wow that was odd. I just wrote an very long comment but
    after I clicked submit my comment didn’t appear. Grrrr…
    well I’m not writing all that over again. Anyhow, just wanted to say wonderful
    blog! scoliosis

  36. https://6869milesoflove.tumblr.com/

    free dating sites
    Spot on with this write-up, I honestly feel this amazing site needs far more attention.
    I’ll probably be returning to see more, thanks for the info!
    free dating sites

  37. bit.ly

    scoliosis
    I couldn’t resist commenting. Perfectly written! scoliosis

  38. asmr a

    This design is wicked! You obviously know how to keep a
    reader entertained. Between your wit and your videos,
    I was almost moved to start my own blog (well, almost…HaHa!)
    Great job. I really loved what you had to say, and more than that, how you presented it.
    Too cool!

  39. a dating sites

    Spot on with this write-up, I seriously believe this
    amazing site needs far more attention. I’ll probably be returning to
    read through more, thanks for the info!

  40. when surgery scoliosis

    Definitely imagine that which you said. Your favourite justification seemed to be
    on the internet the simplest factor to bear in mind of.
    I say to you, I definitely get annoyed at the same time as folks consider worries that they plainly
    don’t realize about. You controlled to hit the nail
    upon the highest and also outlined out the whole thing with no need side-effects
    , other people can take a signal. Will probably
    be back to get more. Thank you

  41. surgery scoliosis why

    Hi my loved one! I want to say that this article is amazing, great written and include almost all
    important infos. I would like to look extra
    posts like this .

  42. this free dating sites

    Howdy very cool website!! Guy .. Beautiful ..

    Wonderful .. I’ll bookmark your blog and take the feeds additionally?
    I’m glad to search out a lot of useful information right here in the publish, we want
    work out more techniques on this regard, thanks for sharing.
    . . . . .

  43. but dating sites

    Wow, marvelous blog layout! How long have you been blogging for?
    you make blogging look easy. The overall look of your website is magnificent, let alone the content!

Leave a Reply

Your email address will not be published.