{"id":5440,"date":"2019-04-05T21:14:10","date_gmt":"2019-04-05T19:14:10","guid":{"rendered":"https:\/\/monodes.com\/predaelli\/?p=5440"},"modified":"2019-04-05T13:15:04","modified_gmt":"2019-04-05T11:15:04","slug":"unix-linux-trick-cd-back-to-the-previous-directory","status":"publish","type":"post","link":"https:\/\/monodes.com\/predaelli\/2019\/04\/05\/unix-linux-trick-cd-back-to-the-previous-directory\/","title":{"rendered":"Unix\/Linux trick: &#8216;cd&#8217; back to the previous directory"},"content":{"rendered":"<blockquote><p>You know when you\u2019re in a very \u201cdeep\u201d directory, such as \/usr\/local\/src\/this\/that\/thatother, and you type \u201ccd\u201d and press enter by mistake ((happens a lot when you thin\u2026<\/p><\/blockquote>\n<p>Source: <em><a href=\"http:\/\/winterdrake.com\/unixlinux-trick-cd-back-to-the-previous-directory\/\">Unix\/Linux trick: &#8216;cd&#8217; back to the previous directory<\/a><\/em><\/p>\n<p>Shortly, is as simple as \u00ab<code class=\"\" data-line=\"\">cd<\/code> -\u00bb. Since true knowledge lies in manpages, here&#8217;s the right quote:<\/p>\n<blockquote><p>An argument of &#8211; is equivalent to $OLDPWD.<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\">You know when you\u2019re in a very \u201cdeep\u201d directory, such as \/usr\/local\/src\/this\/that\/thatother, and you type \u201ccd\u201d and press enter by mistake ((happens a lot when you thin\u2026 Source: Unix\/Linux trick: &#8216;cd&#8217; back to the previous directory Shortly, is as simple as \u00abcd -\u00bb. Since true knowledge lies in manpages, here&#8217;s the right quote: An argument&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/monodes.com\/predaelli\/2019\/04\/05\/unix-linux-trick-cd-back-to-the-previous-directory\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[72],"tags":[],"class_list":["post-5440","post","type-post","status-publish","format-standard","hentry","category-documentations"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6daft-1pK","jetpack-related-posts":[{"id":178,"url":"https:\/\/monodes.com\/predaelli\/2015\/05\/21\/linux-into-a-windows-domain-active-directory\/","url_meta":{"origin":5440,"position":0},"title":"Linux into a Windows Domain (Active Directory)","author":"Paolo Redaelli","date":"2015-05-21","format":false,"excerpt":"Once it was called LikeWise-open, now it's new name is powerbrokeropen.org and\u00a0 allows Active Directory authentication for Linux, UNIX, and Mac systems by joining them to Active Directory domains. It integrates very very well into a GNU\/Linux system, using Pluggable Authentication Modules (PAM) and Name Service Switch (NSS) and it\u2026","rel":"","context":"In &quot;Senza categoria&quot;","block_context":{"text":"Senza categoria","link":"https:\/\/monodes.com\/predaelli\/category\/senza-categoria\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6480,"url":"https:\/\/monodes.com\/predaelli\/2020\/01\/25\/advanced-cli-commands-you-should-know-as-a-developer\/","url_meta":{"origin":5440,"position":1},"title":"Advanced CLI: Commands You Should Know as a Developer","author":"Paolo Redaelli","date":"2020-01-25","format":"link","excerpt":"Advanced CLI: Commands You Should Know as a Developer May I feel a little proud when I tell you I know them all? :) Advanced CLI: Commands You Should Know as a Developer Advanced commands; get more done No, in this article we won\u2019t go over the basic commands like\u2026","rel":"","context":"In &quot;Documentations&quot;","block_context":{"text":"Documentations","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":11886,"url":"https:\/\/monodes.com\/predaelli\/2024\/09\/01\/git-copy-a-file-or-directory-from-another-repository-preserving-the-history\/","url_meta":{"origin":5440,"position":2},"title":"Git: Copy a file or directory from another repository preserving the history","author":"Paolo Redaelli","date":"2024-09-01","format":"quote","excerpt":"How to copy a file or directory from another GIT repository while preserving its history? Internet is full of magic formulas each one more complex. Here I\u2019m proposing a much simpler and faster one that is to make a git format-patch for the entire history of the file or subdirectory\u2026","rel":"","context":"In &quot;Tricks&quot;","block_context":{"text":"Tricks","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/tricks\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5064,"url":"https:\/\/monodes.com\/predaelli\/2018\/12\/13\/how-to-force-ssh-client-to-use-only-password-auth-unix-linux-stack-exchange\/","url_meta":{"origin":5440,"position":3},"title":"How to force ssh client to use only password auth? &#8211; Unix &#038; Linux Stack Exchange","author":"Paolo Redaelli","date":"2018-12-13","format":false,"excerpt":"How to force ssh client to use only password auth? - Unix & Linux Stack Exchange ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no example.com","rel":"","context":"In &quot;Documentations&quot;","block_context":{"text":"Documentations","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1895,"url":"https:\/\/monodes.com\/predaelli\/2016\/11\/15\/50-most-frequently-used-unix-linux-commands-with-examples\/","url_meta":{"origin":5440,"position":4},"title":"50 Most Frequently Used UNIX \/ Linux Commands (With Examples)","author":"Paolo Redaelli","date":"2016-11-15","format":false,"excerpt":"Several pearl in 50 Most Frequently Used UNIX \/ Linux Commands (With Examples) Add line number for all non-empty-lines in a file $ sed '\/.\/=' thegeekstuff.txt | sed 'N; s\/\\n\/ \/' Remove duplicate lines using awk $ awk '!($0 in array) { array[$0]; print }' temp \u00a0 Print all lines\u2026","rel":"","context":"In &quot;Documentations&quot;","block_context":{"text":"Documentations","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8735,"url":"https:\/\/monodes.com\/predaelli\/2021\/09\/30\/linux-logout-automatico-per-inattivita\/","url_meta":{"origin":5440,"position":5},"title":"Linux: logout automatico per inattivit\u00e0","author":"Paolo Redaelli","date":"2021-09-30","format":false,"excerpt":"In questa breve guida vi mostro come impostare il logout automatico dalla sessione su sistemi Linux e Unix-like. Source: [GUIDA] Linux: come effettuare il logout automatico per inattivit\u00e0 Ovviamente dalla shell (linea di comando). Basta impostare la variable d'ambiente TMOUT. Mai smettere d'imparare. Ovviamente si pu\u00f2 Configurare l'uscita automatica anche\u2026","rel":"","context":"In &quot;Documentations&quot;","block_context":{"text":"Documentations","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/"},"img":{"alt_text":"","src":"https:\/\/external-content.duckduckgo.com\/ip3\/help.gnome.org.ico","width":350,"height":200},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/5440","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/comments?post=5440"}],"version-history":[{"count":0,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/5440\/revisions"}],"wp:attachment":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/media?parent=5440"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/categories?post=5440"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/tags?post=5440"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}