It will only work if the service NETSEND in the Windows machine is enabled.
the middle command between the ; and ; is the vi commands that insert that line into the last line of the file, the esc with the carets is literally hitting the escape key, you have to have the smbfs package installed to do it, I use it to access my iTunes music on my mac from my linux PC's with amarok so I can play the music anywhere in the house. among other things, it allows you to access the files on that share from your computer anytime you're on that network.
Control (stop, start, restart) a Windows Service from a Linux machine which has the `net` command (provided by samba). Show Sample Output
This commando copies the file (which must reside in the current directory) to //<server>/<share-name>/<subdirectory>/<file> through the CIFS protocol (Samba share or Windows Share). It doesn't require you to mount the filesystem first.
--directory "<subdirectory>" may be omitted in order to copy the file the the root of the share.
The "%password" part may also be omitted. If doing so, smbclient will ask for the password interactively.
To copy a file from a Windows/Samba share, change "put" for "get".
smbclient --user=user%password --directory "<subdirectory>" --command "get <file>" //<server>/<share-name>
Show Sample Output
Checks for PC samba name and workgroup. Works fine for Windows hosts and Linux/UNIX PCs running Samba. Show Sample Output
otherwise you get this error message: svn: Can't move '.svn/tmp/entries' to '.svn/entries': Operation not permitted
This is a handy command to put into ~/.bash_logout to automatically un-mount windows shares whenever the user logs out. If you use this on as a non-root account then you'll need to append sudo before umount and the user will need to have the appropriate sudoer rights to run the /bin/umount command.
### for ADUSER in $(wbinfo -u --domain="$(wbinfo --own-domain)" | sort); do WBSEP=$(wbinfo --separator); ADUNAME=$(wbinfo -i "$ADUSER" | cut -d ":" -f5); UINFO=$(wbinfo -i "$ADUSER" | cut -d ":" -f3); GINFO=$(wbinfo -i "$ADUSER" | cut -d ":" -f4); SIDU=$(wbinfo -U "$UINFO"); SIDG=$(wbinfo -G "$GINFO"); USERID=$(wbinfo -s "$SIDU" | sed 's/.\{1\}$//' | cut -d "$WBSEP" -f2); GROUPID=$(wbinfo -s "$SIDG" | sed 's/.\{1\}$//' | cut -d "$WBSEP" -f2); echo -e "$ADUSER:$USERID:$ADUNAME:$GROUPID"; done | column -tx -s: ### Show Sample Output
### for ADUSER in $(wbinfo -u --domain="$(wbinfo --own-domain)" | sort); do WBSEP=$(wbinfo --separator); ADUNAME=$(wbinfo -i "$ADUSER" | cut -d ":" -f5); UINFO=$(wbinfo -i "$ADUSER" | cut -d ":" -f4); SIDG=$(wbinfo -G "$UINFO"); GROUPID=$(wbinfo -s "$SIDG" | sed 's/.\{1\}$//' | cut -d "$WBSEP" -f2); echo -e "$ADUSER ($ADUNAME)\n$(printf '%.s-' {1..32})\n\t[*] $GROUPID"; for GID in $(wbinfo -r "$ADUSER"); do SID=$(wbinfo -G "$GID"); GROUP=$(wbinfo -s "$SID" | cut -d " " -f1,2); echo -e "\t[ ] $(echo -e "${GROUP/%?/}" | cut -d "$WBSEP" -f2)"; done | sed '1d'; echo -e "$(printf '%.s=' {1..32})\n"; done ### Show Sample Output
mounts a samba share on a remote machine using a credentials file that can be in a file tht is not accessable by other users the file will look like: username="username" password="password" best option i belive
smbfs or cifs, depends on which you are using
See smbstatus Output within a 5 second interval (for monitoring smb access)
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: