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

284 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!

  44. Tammy

    Aw, this was a very good post. Spending some time and actual effort to generate a good article… but what can I say… I put things off a lot and never manage to get anything done.

  45. Ebony

    I every time used to study paragraph in news papers but now as I
    am a user of net so from now I am using net for articles or reviews,
    thanks to web.

  46. tinyurl.com

    It’s awesome to pay a quick visit this web page and reading the
    views of all colleagues concerning this piece of writing, while I am also zealous of getting know-how.

  47. bit.ly

    Greetings! I know this is kinda off topic but I was wondering if you
    knew where I could get a captcha plugin for my comment form?
    I’m using the same blog platform as yours and I’m having trouble finding one?
    Thanks a lot!

  48. tinyurl.com

    Useful information. Fortunate me I found your site by chance, and I
    am surprised why this twist of fate didn’t came about
    earlier! I bookmarked it.

  49. tinyurl.com

    I like reading through a post that will make people think.

    Also, thank you for allowing for me to comment!

  50. j.mp

    What’s up to all, the contents present at this site are actually amazing for people experience, well, keep
    up the good work fellows.

  51. of gamefly

    Great website you have here but I was wondering if you knew of any forums that cover the same topics talked about in this article?

    I’d really like to be a part of online community where I can get feed-back from
    other experienced people that share the same interest.
    If you have any recommendations, please let me know. Thanks a lot!

  52. what ps4 games

    excellent publish, very informative. I ponder why the opposite specialists of this sector don’t realize this.
    You must proceed your writing. I’m confident, you’ve a great readers’ base already!

  53. in ps4 games

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

  54. ps4 games is

    Hello, i think that i saw you visited my site thus i came to “return the favor”.I’m attempting to find things to enhance my web site!I suppose its ok to use a few of your ideas!!

  55. are web hosting

    Nice blog! Is your theme custom made or did you download it from somewhere?
    A design like yours with a few simple adjustements would really make my blog shine.
    Please let me know where you got your theme. Thanks

  56. t.co

    What i don’t realize is actually how you are no longer really much more smartly-appreciated than you might be right now.
    You’re so intelligent. You know therefore significantly relating to this
    topic, made me for my part believe it from so many various
    angles. Its like men and women don’t seem to be fascinated unless it’s something
    to accomplish with Lady gaga! Your own stuffs excellent.
    All the time deal with it up!

  57. t.co

    Hello it’s me, I am also visiting this web site daily,
    this site is actually fastidious and the people are
    in fact sharing fastidious thoughts.

  58. j.mp

    Your style is really unique compared to other folks I have read stuff
    from. Thank you for posting when you have the opportunity, Guess I
    will just bookmark this blog.

  59. for scoliosis surgery

    Excellent web site. Lots of useful information here.
    I am sending it to some buddies ans also sharing in delicious.

    And obviously, thank you to your effort!

  60. asmr our

    I do agree with all the ideas you have presented for your post.
    They’re very convincing and can certainly work. Still, the posts are too brief for beginners.
    Could you please prolong them a little from subsequent time?
    Thanks for the post.

  61. bitly.com

    These are truly enormous ideas in regarding blogging. You have touched
    some good things here. Any way keep up wrinting.

  62. scoliosis surgery in

    Excellent post. I was checking constantly this blog and I am
    impressed! Very helpful information specially the last part
    :) I care for such info much. I was looking for this particular info for a very long time.
    Thank you and good luck.

  63. are asmr

    This is very fascinating, You’re a very professional blogger.
    I have joined your feed and sit up for searching for more of your excellent post.
    Additionally, I have shared your website in my social networks

  64. bit.ly

    Thanks for the marvelous posting! I certainly enjoyed reading it, you can be a
    great author. I will make sure to bookmark your blog and will come back very soon. I
    want to encourage you continue your great posts, have a nice holiday weekend!
    cheap flights http://1704milesapart.tumblr.com/ cheap flights

  65. j.mp

    Hey There. I found your blog using msn. This is a really well written article.
    I will make sure to bookmark it and come back to read more of
    your useful info. Thanks for the post. I’ll certainly comeback.
    ps4 https://bit.ly/3nkdKIi ps4

  66. AAecpsi

    Холостячка 2 сезон https://bit.ly/39ioLkW Смотреть онлайн шоу Холостячка 2 сезон на СТБ.
    Пост шоу можно смотреть тут. Холостячка стб 2 сезон 1-2 серия

  67. AAxonfq

    Холостячка 2 сезон https://bit.ly/39ioLkW Смотреть онлайн шоу Холостячка 2 сезон на СТБ.
    Пост шоу можно смотреть тут. Холостячка стб 2 сезон 1-2 серия

  68. AAwwekx

    Холостячка 2 сезон https://bit.ly/39ioLkW Смотреть онлайн шоу Холостячка 2 сезон на СТБ.
    Пост шоу можно смотреть тут. Холостячка стб 2 сезон 1-2 серия

  69. AAiskuq

    Холостячка 2 сезон https://bit.ly/39ioLkW Смотреть онлайн шоу Холостячка 2 сезон на СТБ.
    Пост шоу можно смотреть тут. Холостячка стб 2 сезон 1-2 серия

  70. AArgene

    Сериал и фильмов о Чернобыль было очень много, все они по-своему интересны. Однако именно американский канал HBO создал действительно интересный. Сериал чернобыль отчуждения. Новые хорошие сериалы онлайн.

  71. Психологи онлайн

    Услуги консультации психолога.

    Психологи онлайн Заказать консультацию психолога.
    Профессиональные психологи. Консультация и лечение психотерапевта (психолога) Психолог в Харькове, консультация.
    Психологи онлайн. Консультация психолога в Киеве

  72. AAfrbza

    Бій Усик-Джошуа: назвали призові британця | Новини на Смотреть онлайн прямую трансляцию боя Энтони Джошуа – Александр Усик 25.09.2021 Бокс Видео бокса Бій Усик – Джошуа пройде 25 вересня в Лондоні. На кону в цьому поєдинку стоятимуть титули чемпіона світу в суперважкій вазі за версіями ibf, wbo, wba та ibo, якими володіє Джошуа.

  73. Sam

    Every weekend i used to pay a quick visit this website, for the
    reason that i wish for enjoyment, since this this web
    page conations in fact nice funny data too.

  74. Ralf

    terrific and also impressive blog site. I really want
    to thank you, for providing us far better information.

  75. Kellee

    If you can create extra writing such as this,
    I would be really appreciative. Anyway, thank you so much!

  76. Sherrill

    Hi there, just became aware of your blog through Google,
    and found that it’s truly informative.
    I’m gonna watch out for brussels. I’ll
    appreciate if you continue this in future.
    Numerous people will be benefited from your writing.
    Cheers!

  77. Alana

    Wow, this article is nice, my younger sister is analyzing such things,
    thus I am going to tell her.

Leave a Reply

Your email address will not be published.