{"id":22,"date":"2011-04-19T08:50:00","date_gmt":"2011-04-19T08:50:00","guid":{"rendered":"http:\/\/mattdturner.com\/wordpress\/?p=22"},"modified":"2011-04-26T11:42:31","modified_gmt":"2011-04-26T17:42:31","slug":"useful-cshrc-commands","status":"publish","type":"post","link":"http:\/\/mattdturner.com\/wordpress\/2011\/04\/useful-cshrc-commands\/","title":{"rendered":"Useful .cshrc Commands"},"content":{"rendered":"<p><span style=\"line-height: 24px;\"><span style=\"font-family: inherit;\">Throughout the years of using the command line in both Linux and Mac, I have spent quite a bit of time modifying my .cshrc file to my liking. <\/span><\/span><br \/>\n<span style=\"line-height: 24px;\"><span style=\"font-family: inherit;\"><br \/>\nThis is mainly just a list of some commands that I think are useful.<br \/>\n<code><br \/>\n# Prompt - Displayed as \u201c@<strong>:<\/strong>\u201d<br \/>\nset prompt=\"`whoami`@%B`hostname -s`%B:\" #Custom Prompt settings<\/code><\/span><\/span><\/p>\n<p><code> <\/code><\/p>\n<p><code>alias lsl 'ls -larth'<br \/>\nalias qstatme 'qstat -u mturner'<br \/>\nalias qsubm 'qsub -I -V -l walltime=08:00:00,nodes=1:ppn=24'<br \/>\nalias quota '\/usr\/bin\/quota -s -u mturner'<\/code><\/p>\n<p>The \u201clsl\u201d alias should be self explanatory.<br \/>\n\u201cqstatme\u201d displays the current PBS queue for my username only.<br \/>\n\u201cqsubm\u201d will start an interactive PBS job, using 1 full node, and requesting 8 hours.<br \/>\n\u201cquota\u201d will display my quota<br \/>\n<code><br \/>\n# set title<br \/>\nalias cwdcmd 'echo -n \"?33]0;$cwd?07\"'<\/code><\/p>\n<p>\u201ccwdcmd\u201d will change the title of the terminal window to match the current working directory<\/p>\n<p><a name=\"more\"><\/a><span style=\"line-height: 24px;\"><span style=\"font-family: inherit;\"><code><br \/>\n# ignore files for autocompletion<br \/>\nset fignore=(.o .mod)<\/code><\/span><\/span><\/p>\n<p>The fignore environment variable tells the command line to ignore files that end in \u2018.o\u2019 or \u2018.mod\u2019 when doing autocompletion.<\/p>\n<p>Lastly, a few lines for those of us who frequently run interactive jobs in PBS<\/p>\n<pre><span style=\"font-family: inherit;\"><code># automatically move to directory interactive job is started from\r\nif ($?PBS_ENVIRONMENT == 1) then\r\n         if ( $PBS_ENVIRONMENT == PBS_INTERACTIVE ) then\r\n                cd $PBS_O_WORKDIR\r\n                echo 'Beginning Job     : '$PBS_JOBID\r\n                echo 'Running on        : '$HOST\r\n                echo 'Current Directory : '$PBS_O_WORKDIR\r\n                echo ' '\r\n        endif\r\nendif<\/code><\/span><\/pre>\n<p><span style=\"font-family: inherit;\"><br \/>\nThis bit of code will detect if the user has submitted an interactive job. If so, it will change the user\u2019s directory to the directory from which the job was submitted. It will then display the job ID, the host, and the current working directory.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Throughout the years of using the command line in both Linux and Mac, I have spent quite a bit of time modifying my .cshrc file to my liking. This is mainly just a list of some commands that I think are useful. # Prompt &#8211; Displayed as \u201c@:\u201d set prompt=&#8221;`whoami`@%B`hostname -s`%B:&#8221; #Custom Prompt settings alias [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3],"tags":[35,33,34],"class_list":["post-22","post","type-post","status-publish","format-standard","hentry","category-command-line","tag-alias","tag-cshrc","tag-pbs","no-thumb"],"_links":{"self":[{"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/posts\/22"}],"collection":[{"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/comments?post=22"}],"version-history":[{"count":2,"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/posts\/22\/revisions"}],"predecessor-version":[{"id":55,"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/posts\/22\/revisions\/55"}],"wp:attachment":[{"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/media?parent=22"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/categories?post=22"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/mattdturner.com\/wordpress\/wp-json\/wp\/v2\/tags?post=22"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}