- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I want to know which UNIX command generally uses when we work with SAS. I know some of the commands like CP, NO HUP, but I want to know more which we can use on a daily basis while we work with SAS.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
There are literally hundreds of Unix commands and they vary in syntax between Unix flavours. If you have a specific requirement then post what it is but you should also just be able to google and find the command you want anyway.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Just a few off the top of my head
- rm - removes a file or directory (directory must be empty)
- mv - moves (renames) a file or directory
- cp - copies a file
- mkdir - creates a directory
- cd - changes to a directory
- pwd - shows the current directory
- find - finds files in a directory tree
- ls - lists contents of a directory
- grep - finds text in a file or input stream
- head - displays top of a file
- tail - displays end of a file
- wc - counts words, lines, characters in a file
- ps - lists current processes
- date - displays dates (current, or in relation to another date)
- pg, more, less - displays files one page at a time
- sort - sorts an input stream
- cut - extracts columns from an input stream
- who - shows currently logged in users, but can also (-b) display the last time the system was started
It is very important to understand the piping mechanism, which allows to direct the output of one command to the input of another, e.g.
ls | grep x
displays all directory entries having an x in their name, or
sort < a > b
reads file a, and writes the sorted output to file b.
Also learn the syntax of the shell (most often bash), so you can write scripts with conditions and loops.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Try YT video tutorials:
https://www.youtube.com/results?search_query=basic+unix+commands
and of course: google -> "basic unix commands" , just from the top:
https://www.math.utah.edu/lab/unix/unix-commands.html
or
https://www.geeksforgeeks.org/essential-linuxunix-commands/
or
Bart
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug
"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings
SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
P.S. One comment. Remember, SAS allows you to write code which is OS independent. Try to use this functionality as often as possible, to make your programs easily portable without need of changing source code.
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug
"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings
SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello @ravi999985
It depends on what you are doing.
1.For any one using SAS EG for using SAS on a UNIX server, a very minimal knowledge of UNIX is sufficient (case sensitivity, file /path conventions etc, may be ssh/scp).
2.For someone using the Unix shell to write and execute SAS code, write/use shell scripts then a good working knowledge of the shell (BASH/KSH whichever that is being used) is needed. Focus on developing a knowledge of shell scripting/programming rather than memorizing a few commands.