70 Answered Questions for the topic UNIX

05/05/21

Write a shell script

Write a shell script which will automatically get executed on logging in. This shellscript should display the present working directory and report whether your friendwhose logname is aa10 has... more

Linux help Assignment Urgent help!

For this assignment you will write a program that allows a user to entertiming data (minutes and seconds) and then print out some information aboutthe entered data.- the program reads input... more

Linux assignment help

For this assignment you will write a program that allows a user to entertiming data (minutes and seconds) and then print out some information aboutthe entered data.Context:A drop of sweat dripped... more

Linux Programming Help

For this assignment you will write a program that allows a user to entertiming data (minutes and seconds) and then print out some information aboutthe entered data.Context:A drop of sweat dripped... more

Help with using VIM editor in Linux

Edit hello.cpp using vimUse vim editor to edit hello.cpp, to have a custom message then recompile the program and run it again.(I dont know what im supposed to type please help)

Help with Computer Science assignment

#1.Create the Hello World program using vi. Save it in your home directory. Instead of the using the “Hello World!” in cout, replace it with “Hello, your name!”Compile the program using g++. This... more

Linux Assignment Urgent Help

INSTRUCTIONSThese three activities are three little shell programs to create and review, one called svi.sh and the other uon.sh, the other is the command_menu program at the bottom of page 456.... more

computer science question

Create this sample file, you can call it student... more

UNIX Assignment

Log on to your UNIX system1. Give three different commands to get back to your home directory.2. Show the names of all hidden files in your home directory. Show your session.3. Write down the... more

06/17/19

What is the Windows equivalent of the Unix command cat? ?

I want to do exactly what unix "cat" does, but on my PC. Is there a simple equivalent command for the Windows command line? Specifically I want to create a file from all the files of a given type... more

06/03/19

What is the fastest way to get the value of π?

I'm looking for the fastest way to obtain the value of π, as a personal challenge. More specifically, I'm using ways that don't involve using `#define` constants like `M_PI`, or hard-coding the... more
Unix Shell Vim Ssh

06/03/19

Delete newline in Vim?

Is there a way to delete the newline at the end of a line in Vim, so that the next line is appended to the current line? For example: Evaluator<T>(): _bestPos(){ } I'd like to put this... more

06/02/19

Extract file basename without path and extension in bash?

Given file names like these: /the/path/foo.txt bar.txt I hope to get: foo bar Why this doesn't work? #!/bin/bash fullfile=$1 fname=$(basename $fullfile) fbname=${fname%.*} echo... more
Unix Linux Diff Bash

05/30/19

Given two directory trees, how can I find out which files differ?

If I want find the differences between two directory trees, I usually just execute: diff -r dir1/ dir2/ This outputs exactly what the differences are between corresponding files. I'm interested... more
Unix Linux Bash Grep

05/29/19

How can I format my grep output to show line numbers at the end of the line, and also the hit count?

I'm using grep to match string in a file. Here is an example file: example one, example two null, example three, example four null, `grep -i null myfile.txt` returns example two null, ... more
Unix

05/29/19

Unix: How to check permissions of a specific directory?

I know that using `ls -l "directory/directory/filename"` tells me the permissions of a file. How do I do the same on a directory? I could obviously use `ls -l` on the directory higher in the... more
Unix Bash Shell

05/27/19

How to represent multiple conditions in a shell if statement?

I want to represent multiple conditions like this: if [ ( $g -eq 1 -a "$c" = "123" ) -o ( $g -eq 2 -a "$c" = "456" ) ] then echo abc; else echo efg; fi but when I execute the script,... more

05/26/19

Why should text files end with a newline?

I assume everyone here is familiar with the adage that all text files should end with a newline. I've known of this "rule" for years but I've always wondered — why?

How can I extract a predetermined range of lines from a text file on Unix?

I have a ~23000 line SQL dump containing several databases worth of data. I need to extract a certain section of this file (i.e. the data for a single database) and place it in a new file. I know... more

05/26/19

In Unix, can I run 'make' in a directory without cd'ing to that directory first?

In Unix, can I run 'make' in a directory without cd'ing to that directory first?

05/26/19

Remove carriage return in Unix?

What is the simplest way to remove all the carriage returns `\\r` from a file in Unix?

05/26/19

Concatenate multiple files but include filename as section headers?

I would like to concatenate a number of text files into one large file in terminal. I know I can do this using the cat command. However, I would like the filename of each file to precede the "data... more

05/26/19

Loop through an array of strings in Bash?

I want to write a script that loops through 15 strings (array possibly?) Is that possible? Something like: for databaseName in listOfNames then # Do something end
Unix Grep

05/26/19

grep a tab in UNIX?

How do I `grep` tab (\ ) in files on the Unix platform?

05/26/19

How to assign name for a screen?

I'm using the `screen` multiplexer tool on the command shell and open a lot of screens. I then forget which process ID associates with which task. I would like to set a name for a screen but can't... more

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.