BookmarkSubscribeRSS Feed
ravi999985
Calcite | Level 5

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.

 

 

 

5 REPLIES 5
SASKiwi
PROC Star

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.

Kurt_Bremser
Super User

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.

yabwon
Onyx | Level 15

#Maxim6

 

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

https://kb.iu.edu/d/afsk

 

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



yabwon
Onyx | Level 15

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



Sajid01
Meteorite | Level 14

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.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 337 views
  • 6 likes
  • 5 in conversation