Questions tagged [solaris]

Solaris is a commercial Unix operating system sold by Oracle, previously (before 2010) from Sun Microsystems. It can run on SPARC or x86 hardware.

Solaris is a Unix operating system originally developed by Sun Microsystems as a successor to SunOS. Oracle Solaris, as it is now known, has been owned by Oracle Corporation since Oracle's acquisition of Sun in January 2010. OpenSolaris (the open-source version of Solaris) was abandoned at that point.

Solaris is known for its scalability, especially on SPARC systems (), and for originating many innovative features such as DTrace, ZFS and Time Slider. Solaris supports SPARC-based and x86-based workstations and servers from Sun and other vendors.

Resources

2780 questions
500
votes
15 answers

sed edit file in-place

How do I edit a file in a single sed command? Currently, I have to manually stream the edited content into a new file and then rename the new file to the original file name. I tried sed -i, but my Solaris system said that -i is an illegal option. …
amphibient
  • 29,770
  • 54
  • 146
  • 240
372
votes
18 answers

Test if remote TCP port is open from a shell script

I'm looking for a quick and simple method for properly testing if a given TCP port is open on a remote server, from inside a Shell script. I've managed to do it with the telnet command, and it works fine when the port is opened, but it doesn't seem…
Yanick Girouard
  • 4,711
  • 4
  • 19
  • 26
220
votes
19 answers

Get the date (a day before current time) in Bash

How can I print the date which is a day before current time in Bash?
conandor
  • 3,637
  • 6
  • 29
  • 36
165
votes
17 answers

How do I get the find command to print out the file size with the file name?

If I issue the find command as follows: find . -name *.ear It prints out: ./dir1/dir2/earFile1.ear ./dir1/dir2/earFile2.ear ./dir1/dir3/earFile1.ear I want to 'print' the name and the size to the command line: ./dir1/dir2/earFile1.ear 5000…
Brian
  • 13,412
  • 10
  • 56
  • 82
145
votes
16 answers

Portable way to get file size (in bytes) in the shell

On Linux, I use stat --format="%s" FILE, but the Solaris machine I have access to doesn't have the stat command. What should I use then? I'm writing Bash scripts and can't really install any new software on the system. I've considered already…
user80168
48
votes
4 answers

How to use qemu to run a non-gui OS on the terminal?

I want to run some programs on the High Performance Computer (With 8-core processor) in my department. Now I use that machine with ssh using terminal. The machine has Red Hat linux installed on it. But my programs need to run on Solaris. I use…
MetallicPriest
  • 29,191
  • 52
  • 200
  • 356
47
votes
8 answers

How to set the From email address for mailx command?

I am working on a KornShell (ksh) script running on a Solaris server that will send out an email when and error condition is met. I am sending the email via mailx. Question: How do I set the "From" email address on the mailx command? Current…
AieshaDot
  • 785
  • 3
  • 7
  • 13
46
votes
1 answer

error : NameError: name 'subprocess' is not defined

#!/usr/bin/python3 username = 'joe' # generate passphrase pw_length = 6 phrase = subprocess.check_output(['pwgen', str(pw_length), '1']) phrase = phrase.decode('utf-8').strip() dev_null = open('/dev/null', 'w') passwd = subprocess.Popen(['sudo',…
munish
  • 4,505
  • 14
  • 53
  • 83
37
votes
8 answers

How to determine the IP address of a Solaris system

What command do I want to issue when I want to know the IP address of the Solaris machine I'm logged onto?
James Adams
  • 8,448
  • 21
  • 89
  • 148
32
votes
4 answers

Error importing hashlib with python 2.7 but not with 2.6

I'm on Solaris 10 (x86). Until now, I was using python2.6. Today, I installed python2.7 and I have a weird error occuring when importing hashlib on 2.7, but not on 2.6: Python 2.6: root@myserver [PROD] # python2.6 -c "import hashlib" root@myserver…
SuperPython
  • 1,007
  • 2
  • 12
  • 24
32
votes
4 answers

Why should the shebang line always be the first line?

I have a simple perl script as below: #!/usr/bin/perl use strict; use warnings; print "hello world!\n"; I can execute this script as below: >temp.pl hello world! > If I add some comments like this: #this script is just for test #the…
Vijay
  • 65,327
  • 90
  • 227
  • 319
32
votes
1 answer

Difference between an inline function and static inline function

Can anybody tell me what the difference is between an inline function and static inline function? In which cases should I prefer static inline over inline? I am asking this question because I have an inline function for which I am facing compilation…
Vijay
  • 65,327
  • 90
  • 227
  • 319
31
votes
11 answers

What process is listening on a certain port on Solaris?

So I log into a Solaris box, try to start Apache, and find that there is already a process listening on port 80, and it's not Apache. Our boxes don't have lsof installed, so I can't query with that. I guess I could do: pfiles `ls /proc` | less and…
Please delete this account
31
votes
1 answer

What is the reason and how to avoid the [FIN, ACK] , [RST] and [RST, ACK]

What is the reason and how to avoid the [FIN, ACK], [RST] and [RST, ACK]? Is it due to some mismatch between the TCP parameters of the SO´s? What does it mean when the server replies [FIN, ACK] in a TCP/IP connection? 10.118.113.237 is a Solaris…
Sergio Pettena
  • 319
  • 1
  • 3
  • 3
30
votes
3 answers

Alternative to `sed -i` on Solaris

On Linux sed -i will modify the input files in place. It doesn't work on Solaris, though. sed -i '$ s/OLD/NEW/g' test sed: illegal option -- i What can I use in place of sed -i on Solaris?
lidia
  • 3,043
  • 14
  • 42
  • 47
1
2 3
99 100