unix

error using “find” command in unix

这一生的挚爱 提交于 2020-03-04 05:09:25
问题 I was just trying the below code and it is not working.. please suggest to correct this code.. echo abc.txt | while read name; do find . -name $name; done output success : ./rak/abc.txt echo 'abc.txt pqr.txt' | while read name; do find . -name $name; done output error : find: 0652-009 There is a missing conjunction echo "abc.txt pqr.txt" | while read name; do find . -name $name; done output error : find: 0652-009 There is a missing conjunction same error with echo "abc.txt" "pqr.txt" | while

Getting 'E/launcher - Error: spawn EACCES' error while trying to run protractor tests in Unix machine

北城以北 提交于 2020-03-03 08:48:28
问题 I am getting below mentioned error while running the protractor tests in headless mode in Unix machine. Thinking it might be due to some permission issue, I gave execute permission to 'protractor' file in protractor/bin folder and to the protractor conf file, but no help. [12:27:50] I/launcher - Running 1 instances of WebDriver [12:27:50] I/direct - Using ChromeDriver directly... [12:27:50] E/launcher - spawn EACCES [12:27:50] E/launcher - Error: spawn EACCES at exports._errnpException (util

GDB命令详解(进一步学习)

*爱你&永不变心* 提交于 2020-03-03 07:24:23
GDB是GNU开源组织发布的一个强大的UNIX下的程序调试工具。如果你是在 UNIX平台下做软件,你会发现GDB这个调试工具有比VC、BCB的图形化调试器更强大的功能。同时GDB也具有例如ddd这样的图形化的调试端。 一般来说,GDB主要完成下面四个方面的功能: (1)启动你的程序,可以按照你的自定义的要求随心所欲的运行程序。 (2)可让被调试的程序在你所指定的调置的断点处停住。(断点可以是条件表达式) (3)当程序被停住时,可以检查此时你的程序中所发生的事。 (4)动态的改变你程序的执行环境。 兴趣是最好的老师,这里先整理总结一下在调试的过程中经常遇到的问题。带着这些问题进行学习和实践可以有助于加深印象。 再往后是本人实践过程中总结的常见命令,如有什么问题或者建议,都可以联系我,谢谢! _ (1)如何打印变量的值?(print var) (2)如何打印变量的地址?(print &var) (3)如何打印地址的数据值?(print *address) (4)如何查看当前运行的文件和行?(backtrace) (5)如何查看指定文件的代码?(list file:N) (6)如何立即执行完当前的函数,但是并不是执行完整个应用程序?(finish) (7)如果程序是多文件的,怎样定位到指定文件的指定行或者函数?(list file:N) (8)如果循环次数很多,如何执行完当前的循环?

.NET Core - directory permissions Linux

孤街浪徒 提交于 2020-03-03 04:27:41
问题 In my Unit Test project for .NET Core I'm trying to create a folder and then limit access permissions. So far I implemented Windows version of this code: DirectoryInfo dirInfo = Directory.CreateDirectory(DriveManager.LogicalDrive + ":\\testDir"); DirectorySecurity dirSecurity = new DirectorySecurity(dirInfo.FullName, AccessControlSections.All); var securityId = System.Security.Principal.WindowsIdentity.GetCurrent().User; FileSystemAccessRule rule = new FileSystemAccessRule(securityId,

cygwin学习

只愿长相守 提交于 2020-03-02 14:27:02
原文链接: https://www.cnblogs.com/endv/p/7674720.html 参考链接: https://zhuanlan.zhihu.com/p/56692626 根据cygwin user guide翻译整理,希望对大家有所帮助。有错误清指出。 1 引言 cygwin是一个在windows平台上运行的unix模拟环境,是cygnus solutions公司开发的自由软件(该公司开发了很多好东西,著名的还有eCos,不过现已被Redhat收购)。它对于学习unix/linux操作环境,或者从unix到windows的应用程序移植,或者进行某些特殊的开发工作,尤其是使用gnu工具集在windows上进行嵌入式系统开发,非常有用。随着嵌入式系统开发在国内日渐流行,越来越多的开发者对cygwin产生了兴趣。本文将对其作一介绍。 --------------------------------------------------------------------- 根据cygwin user guide翻译整理,希望对大家有所帮助。有错误清指出。 1 引言 cygwin是一个在windows平台上运行的unix模拟环境,是cygnus solutions公司开发的自由软件(该公司开发了很多好东西,著名的还有eCos,不过现已被Redhat收购)。它对于学习unix

自定义Unix命令

喜欢而已 提交于 2020-03-01 06:35:16
有时候Unix自带的命令太长记不住或者没有合适的命令,这时候我们可以使用Python来进行包装或者自定义命令。Mac中默认是没有tree命令的,我们可以使用Python进行包装: 1.编写脚本 tree.py # -*- coding: utf-8 -*- import os import sys if __name__ == '__main__': if len(sys.argv) < 2: print len(sys.argv) print("请输入路径!") exit(0) path = sys.argv[1] if not os.path.isdir(path): print("请输入有效的目录路径!") exit(0) cmd = "find {} -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'".format(path) os.system(cmd) 2.编辑 ~/.bash_profile文件 添加 alias tree='python tree.py' source ~/.bash_profile 来源: oschina 链接: https://my.oschina.net/u/2602029/blog/776065

GCC declarations: typedef __pid_t pid_t?

∥☆過路亽.° 提交于 2020-03-01 02:33:25
问题 I am confused about the declaration of (for example) pid_t. What does __pid_t mean? Is it another type defined elsewhere? If yes, where? Why is my types.h in ubuntu 13.04 64bit defining pid_t like: #ifndef __pid_t_defined typedef __pid_t pid_t; #define __pid_t_defined #endif and not something like typedef int pid_t; I saw some websites that have types.h headers with the declaration done the last way. This is one: http://www.sde.cs.titech.ac.jp/~gondow/dwarf2-xml/HTML-rxref/app/gcc-3.3.2/lib

Getting The Full Result from “ps”

限于喜欢 提交于 2020-02-29 20:08:29
问题 How do I get the full width result for the *nix command " ps "? I know we can specify something like --cols 1000 but is there anyway I can the columns and just print out everything? 回答1: Try ps -w -w aux . The -w option sets the output to wide, and doing it twice makes the width unlimited. The "aux" part makes it show more information, and is (afaik) pretty standard mode to use. This is of course platform-dependant, the above works with procps version 3.2.7 on Linux. 回答2: Specify the w option

Getting The Full Result from “ps”

时光怂恿深爱的人放手 提交于 2020-02-29 20:06:51
问题 How do I get the full width result for the *nix command " ps "? I know we can specify something like --cols 1000 but is there anyway I can the columns and just print out everything? 回答1: Try ps -w -w aux . The -w option sets the output to wide, and doing it twice makes the width unlimited. The "aux" part makes it show more information, and is (afaik) pretty standard mode to use. This is of course platform-dependant, the above works with procps version 3.2.7 on Linux. 回答2: Specify the w option

Getting The Full Result from “ps”

旧时模样 提交于 2020-02-29 20:05:53
问题 How do I get the full width result for the *nix command " ps "? I know we can specify something like --cols 1000 but is there anyway I can the columns and just print out everything? 回答1: Try ps -w -w aux . The -w option sets the output to wide, and doing it twice makes the width unlimited. The "aux" part makes it show more information, and is (afaik) pretty standard mode to use. This is of course platform-dependant, the above works with procps version 3.2.7 on Linux. 回答2: Specify the w option